mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-11 02:16:23 +00:00
tried my best to fix types
This commit is contained in:
parent
1c6aaa198c
commit
0bd4f9a74f
3 changed files with 13 additions and 11 deletions
|
@ -4,7 +4,6 @@
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { DataStore } from "@api/index";
|
|
||||||
import { findByCode } from "@webpack";
|
import { findByCode } from "@webpack";
|
||||||
import { ChannelStore, lodash, Toasts, UserStore } from "@webpack/common";
|
import { ChannelStore, lodash, Toasts, UserStore } from "@webpack/common";
|
||||||
import { Channel, Message } from "discord-types/general";
|
import { Channel, Message } from "discord-types/general";
|
||||||
|
@ -49,7 +48,7 @@ export default new (class NoteHandler {
|
||||||
for (const [key, value] of data) {
|
for (const [key, value] of data) {
|
||||||
notes[key] = value;
|
notes[key] = value;
|
||||||
}
|
}
|
||||||
return notes;
|
return notes as HolyNotes.Note[];
|
||||||
}
|
}
|
||||||
|
|
||||||
public addNote = async (message: Message, notebook: string) => {
|
public addNote = async (message: Message, notebook: string) => {
|
||||||
|
@ -71,7 +70,7 @@ export default new (class NoteHandler {
|
||||||
const notes = this.getNotes(notebook);
|
const notes = this.getNotes(notebook);
|
||||||
|
|
||||||
noteHandlerCache.set(notebook, lodash.omit(notes, noteId));
|
noteHandlerCache.set(notebook, lodash.omit(notes, noteId));
|
||||||
saveCacheToDataStore(notebook, lodash.omit(notes, noteId));
|
saveCacheToDataStore(notebook, lodash.omit(notes, noteId) as unknown as HolyNotes.Note[]);
|
||||||
|
|
||||||
Toasts.show({
|
Toasts.show({
|
||||||
id: Toasts.genId(),
|
id: Toasts.genId(),
|
||||||
|
@ -89,8 +88,8 @@ export default new (class NoteHandler {
|
||||||
noteHandlerCache.set(from, lodash.omit(origNotebook, note.id));
|
noteHandlerCache.set(from, lodash.omit(origNotebook, note.id));
|
||||||
noteHandlerCache.set(to, newNoteBook);
|
noteHandlerCache.set(to, newNoteBook);
|
||||||
|
|
||||||
saveCacheToDataStore(from, lodash.omit(origNotebook, note.id));
|
saveCacheToDataStore(from, lodash.omit(origNotebook, note.id) as unknown as HolyNotes.Note[]);
|
||||||
saveCacheToDataStore(to, newNoteBook);
|
saveCacheToDataStore(to, newNoteBook as unknown as HolyNotes.Note[]);
|
||||||
|
|
||||||
|
|
||||||
Toasts.show({
|
Toasts.show({
|
||||||
|
@ -119,8 +118,8 @@ export default new (class NoteHandler {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
noteHandlerCache.set(notebookName, []);
|
noteHandlerCache.set(notebookName, [{}]);
|
||||||
saveCacheToDataStore(notebookName, [{}] as HolyNotes.Note[]);
|
saveCacheToDataStore(notebookName, [{} as HolyNotes.Note]);
|
||||||
|
|
||||||
return Toasts.show({
|
return Toasts.show({
|
||||||
id: Toasts.genId(),
|
id: Toasts.genId(),
|
||||||
|
@ -161,7 +160,7 @@ export default new (class NoteHandler {
|
||||||
|
|
||||||
for (const notebook in notebooks) {
|
for (const notebook in notebooks) {
|
||||||
noteHandlerCache.set(notebook, notebooks[notebook]);
|
noteHandlerCache.set(notebook, notebooks[notebook]);
|
||||||
saveCacheToDataStore(notebook, notebooks[notebook]);
|
saveCacheToDataStore(notebook, notebooks[notebook] as unknown as HolyNotes.Note[]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Toasts.show({
|
Toasts.show({
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
/* stylelint-disable shorthand-property-no-redundant-values */
|
||||||
|
/* stylelint-disable length-zero-no-unit */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$modifier: var(--background-modifier-accent);
|
$modifier: var(--background-modifier-accent);
|
||||||
*/
|
*/
|
||||||
|
@ -115,6 +118,7 @@ $modifier: var(--background-modifier-accent);
|
||||||
color: var(--interactive-normal);
|
color: var(--interactive-normal);
|
||||||
border-bottom-width: 2px;
|
border-bottom-width: 2px;
|
||||||
border-bottom-style: solid;
|
border-bottom-style: solid;
|
||||||
|
/* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties */
|
||||||
border-bottom-color: transparent;
|
border-bottom-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,9 +25,8 @@ export async function getFormatedEntries() {
|
||||||
const notebooks: Record<string, HolyNotes.Note> = {};
|
const notebooks: Record<string, HolyNotes.Note> = {};
|
||||||
|
|
||||||
data.forEach(function (note) {
|
data.forEach(function (note) {
|
||||||
notebooks[note[0]] = note[1];
|
notebooks[note[0].toString()] = note[1];
|
||||||
});
|
});
|
||||||
|
|
||||||
return notebooks;
|
return notebooks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +34,7 @@ export async function DataStoreToCache() {
|
||||||
const data = await DataStore.entries(HolyNoteStore);
|
const data = await DataStore.entries(HolyNoteStore);
|
||||||
|
|
||||||
data.forEach(function (note) {
|
data.forEach(function (note) {
|
||||||
noteHandlerCache.set(note[0], note[1]);
|
noteHandlerCache.set(note[0].toString(), note[1]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue