Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix errors in viewer caused by WsValidation and new Update Api #1288

Merged
merged 2 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/FwLite/MiniLcm/Models/WritingSystemId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public override void WriteAsPropertyName(Utf8JsonWriter writer, WritingSystemId

public WritingSystemId(string code)
{
if (code == "default" || IetfLanguageTag.IsValid(code))
//__key is used by the LfClassicMiniLcmApi to smuggle non guid ids with possibilitie lists
if (code == "default" || code == "__key" || IetfLanguageTag.IsValid(code))
{
Code = code;
}
Expand Down
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
Loading