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);
// Editor
rpc EditorUpdateNote(notes.UpdateNotesRequest) returns (generic.Empty);
rpc EditorUpdateNotetype(notetypes.Notetype) returns (generic.Empty);
rpc EditorAddNote(notes.AddNoteRequest) returns (generic.Empty);
rpc UpdateEditorNote(notes.UpdateNotesRequest) returns (generic.Empty);
rpc UpdateEditorNotetype(notetypes.Notetype) returns (generic.Empty);
rpc AddEditorNote(notes.AddNoteRequest) returns (generic.Empty);
rpc ConvertPastedImage(ConvertPastedImageRequest)
returns (ConvertPastedImageResponse);
rpc RetrieveUrl(generic.String) returns (RetrieveUrlResponse);

View file

@ -620,15 +620,15 @@ def editor_op_changes_request(endpoint: str) -> bytes:
return output
def editor_update_note() -> bytes:
def update_editor_note() -> bytes:
return editor_op_changes_request("update_notes")
def editor_update_notetype() -> bytes:
def update_editor_notetype() -> bytes:
return editor_op_changes_request("update_notetype")
def editor_add_note() -> bytes:
def add_editor_note() -> bytes:
return editor_op_changes_request("add_note")
@ -833,9 +833,9 @@ post_handler_list = [
search_in_browser,
deck_options_require_close,
deck_options_ready,
editor_update_note,
editor_update_notetype,
editor_add_note,
update_editor_note,
update_editor_notetype,
add_editor_note,
get_profile_config_json,
set_profile_config_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);
}
await editorUpdateNotetype(notetype);
await updateEditorNotetype(notetype);
setSticky(values);
}
@ -343,7 +343,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
async function updateCurrentNote() {
if (mode !== "add") {
await editorUpdateNote({
await updateEditorNote({
notes: [note!],
skipUndoEntry: false,
});
@ -452,7 +452,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
if (!(await noteCanBeAdded())) {
return;
}
await editorAddNote({
await addEditorNote({
note: note!,
deckId,
});
@ -581,12 +581,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
getNotetype,
encodeIriPaths,
newNote,
editorUpdateNote,
updateEditorNote,
decodeIriPaths,
noteFieldsCheck,
editorAddNote,
addEditorNote,
addMediaFromPath,
editorUpdateNotetype,
updateEditorNotetype,
closeAddCards as closeAddCardsBackend,
} from "@generated/backend";
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 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");
@ -32,7 +32,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
active = !active;
const notetype = await getNotetype({ ntid: note.notetypeId });
notetype.fields[index].config!.sticky = active;
await editorUpdateNotetype(notetype);
await updateEditorNotetype(notetype);
}
function shortcut(target: HTMLElement): () => void {