Skip to content

Commit

Permalink
don't attempt to change entries in readonly mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Nov 28, 2024
1 parent 7eba6dd commit ffb7b13
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/viewer/src/lib/Editor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@
const viewSettings = useViewSettings();
async function onChange(e: { entry: IEntry, sense?: ISense, example?: IExampleSentence }) {
if (readonly) return;
await updateEntry(e.entry);
dispatch('change', {entry: e.entry});
updateInitialEntry();
}
async function onDelete(e: { entry: IEntry, sense?: ISense, example?: IExampleSentence }) {
if (readonly) return;
if (e.example !== undefined && e.sense !== undefined) {
await saveHandler(() => lexboxApi.DeleteExampleSentence(e.entry.id, e.sense!.id, e.example!.id));
} else if (e.sense !== undefined) {
Expand Down

0 comments on commit ffb7b13

Please sign in to comment.