Tweak naming

This commit is contained in:
Abdo 2025-07-03 11:03:03 +03:00
parent dbd8737f0a
commit d0bb1ffd9a
4 changed files with 17 additions and 17 deletions

View file

@ -31,9 +31,9 @@ service FrontendService {
rpc deckOptionsReady(generic.Empty) returns (generic.Empty); rpc deckOptionsReady(generic.Empty) returns (generic.Empty);
// Editor // Editor
rpc EditorUpdateNote(notes.UpdateNotesRequest) returns (generic.Empty); rpc UpdateEditorNote(notes.UpdateNotesRequest) returns (generic.Empty);
rpc EditorUpdateNotetype(notetypes.Notetype) returns (generic.Empty); rpc UpdateEditorNotetype(notetypes.Notetype) returns (generic.Empty);
rpc EditorAddNote(notes.AddNoteRequest) returns (generic.Empty); rpc AddEditorNote(notes.AddNoteRequest) returns (generic.Empty);
rpc ConvertPastedImage(ConvertPastedImageRequest) rpc ConvertPastedImage(ConvertPastedImageRequest)
returns (ConvertPastedImageResponse); returns (ConvertPastedImageResponse);
rpc RetrieveUrl(generic.String) returns (RetrieveUrlResponse); rpc RetrieveUrl(generic.String) returns (RetrieveUrlResponse);

View file

@ -620,15 +620,15 @@ def editor_op_changes_request(endpoint: str) -> bytes:
return output return output
def editor_update_note() -> bytes: def update_editor_note() -> bytes:
return editor_op_changes_request("update_notes") return editor_op_changes_request("update_notes")
def editor_update_notetype() -> bytes: def update_editor_notetype() -> bytes:
return editor_op_changes_request("update_notetype") return editor_op_changes_request("update_notetype")
def editor_add_note() -> bytes: def add_editor_note() -> bytes:
return editor_op_changes_request("add_note") return editor_op_changes_request("add_note")
@ -833,9 +833,9 @@ post_handler_list = [
search_in_browser, search_in_browser,
deck_options_require_close, deck_options_require_close,
deck_options_ready, deck_options_ready,
editor_update_note, update_editor_note,
editor_update_notetype, update_editor_notetype,
editor_add_note, add_editor_note,
get_profile_config_json, get_profile_config_json,
set_profile_config_json, set_profile_config_json,
get_meta_json, get_meta_json,

View file

@ -225,7 +225,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
} }
values.push(field.config!.sticky); values.push(field.config!.sticky);
} }
await editorUpdateNotetype(notetype); await updateEditorNotetype(notetype);
setSticky(values); setSticky(values);
} }
@ -343,7 +343,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
async function updateCurrentNote() { async function updateCurrentNote() {
if (mode !== "add") { if (mode !== "add") {
await editorUpdateNote({ await updateEditorNote({
notes: [note!], notes: [note!],
skipUndoEntry: false, skipUndoEntry: false,
}); });
@ -452,7 +452,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
if (!(await noteCanBeAdded())) { if (!(await noteCanBeAdded())) {
return; return;
} }
await editorAddNote({ await addEditorNote({
note: note!, note: note!,
deckId, deckId,
}); });
@ -581,12 +581,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
getNotetype, getNotetype,
encodeIriPaths, encodeIriPaths,
newNote, newNote,
editorUpdateNote, updateEditorNote,
decodeIriPaths, decodeIriPaths,
noteFieldsCheck, noteFieldsCheck,
editorAddNote, addEditorNote,
addMediaFromPath, addMediaFromPath,
editorUpdateNotetype, updateEditorNotetype,
closeAddCards as closeAddCardsBackend, closeAddCards as closeAddCardsBackend,
} from "@generated/backend"; } from "@generated/backend";
import { wrapInternal } from "@tslib/wrap"; import { wrapInternal } from "@tslib/wrap";

View file

@ -15,7 +15,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { context as editorFieldContext } from "./EditorField.svelte"; import { context as editorFieldContext } from "./EditorField.svelte";
import type { Note } from "@generated/anki/notes_pb"; import type { Note } from "@generated/anki/notes_pb";
import { getNotetype, editorUpdateNotetype } from "@generated/backend"; import { getNotetype, updateEditorNotetype } from "@generated/backend";
const animated = !document.body.classList.contains("reduce-motion"); const animated = !document.body.classList.contains("reduce-motion");
@ -32,7 +32,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
active = !active; active = !active;
const notetype = await getNotetype({ ntid: note.notetypeId }); const notetype = await getNotetype({ ntid: note.notetypeId });
notetype.fields[index].config!.sticky = active; notetype.fields[index].config!.sticky = active;
await editorUpdateNotetype(notetype); await updateEditorNotetype(notetype);
} }
function shortcut(target: HTMLElement): () => void { function shortcut(target: HTMLElement): () => void {