add option to clear suggestions
This commit is contained in:
@@ -215,7 +215,7 @@ export class Chat {
|
||||
};
|
||||
|
||||
handleMessageObject = (messageObject: MessageObject): void => {
|
||||
this.addObject(messageObject);
|
||||
this.addObject(messageObject, true);
|
||||
};
|
||||
|
||||
// sending
|
||||
@@ -348,7 +348,10 @@ export class Chat {
|
||||
messageObject.contentVersions[content.id] = content;
|
||||
};
|
||||
|
||||
addObject = (messageObject: MessageObject): void => {
|
||||
addObject = (
|
||||
messageObject: MessageObject,
|
||||
ignoreIfUnchanged: boolean = false
|
||||
): void => {
|
||||
const existingObject = this.objects.value.get(messageObject.id);
|
||||
if (existingObject) {
|
||||
existingObject.title = messageObject.title;
|
||||
|
||||
@@ -167,6 +167,18 @@ function removeSetDuplicates(listState: React.ListState<any>) {
|
||||
listState.value = new Set([...listState.value]);
|
||||
}
|
||||
|
||||
export function clearAddresses() {
|
||||
previousAddresses.clear();
|
||||
}
|
||||
|
||||
export function clearCategories() {
|
||||
usedObjectCategories.clear();
|
||||
}
|
||||
|
||||
export function clearStatuses() {
|
||||
usedObjectStatuses.clear();
|
||||
}
|
||||
|
||||
const zoomStep = 10;
|
||||
export function zoomOut() {
|
||||
pageZoom.value -= zoomStep;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import {
|
||||
clearCategories,
|
||||
clearStatuses,
|
||||
isPresentingSettingsModal,
|
||||
repairApp,
|
||||
toggleSettings,
|
||||
@@ -8,6 +10,7 @@ import {
|
||||
zoomOut,
|
||||
} from "../Model/model";
|
||||
|
||||
import { icons } from "../icons";
|
||||
import { translation } from "../translations";
|
||||
|
||||
export function SettingsModal() {
|
||||
@@ -30,12 +33,25 @@ export function SettingsModal() {
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<div class="flex-row width-input">
|
||||
<div class="flex-column width-input">
|
||||
<button class="width-100 flex-1" on:click={repairApp}>
|
||||
{translation.repairApp}
|
||||
<span class="icon">handyman</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<div class="flex-column width-input gap">
|
||||
<button class="width-100 flex-1" on:click={clearCategories}>
|
||||
{translation.clearCategories}
|
||||
<span class="icon">{icons.categoryName}</span>
|
||||
</button>
|
||||
<button class="width-100 flex-1" on:click={clearStatuses}>
|
||||
{translation.clearStatuses}
|
||||
<span class="icon">{icons.status}</span>
|
||||
</button>
|
||||
</div>
|
||||
</main>
|
||||
<button class="width-100" on:click={toggleSettings}>
|
||||
{translation.close}
|
||||
|
||||
+10
-1
@@ -16,6 +16,9 @@ const englishTranslations = {
|
||||
zoomIn: "Zoom In",
|
||||
|
||||
repairApp: "Repair App",
|
||||
clearAddresses: "Clear previous connections",
|
||||
clearCategories: "Clear suggestions for object categories",
|
||||
clearStatuses: "Clear suggestions for object statuses",
|
||||
|
||||
// overview
|
||||
overview: "Overview",
|
||||
@@ -142,6 +145,9 @@ const allTranslations: { [key: string]: typeof englishTranslations } = {
|
||||
zoomIn: "Acercar",
|
||||
|
||||
repairApp: "Reparar Aplicación",
|
||||
clearAddresses: "Borrar conexiones previas",
|
||||
clearCategories: "Borrar sugerencias para categorías de objetos",
|
||||
clearStatuses: "Borrar sugerencias para estados de objetos",
|
||||
|
||||
// overview
|
||||
overview: "Resumen",
|
||||
@@ -265,6 +271,9 @@ const allTranslations: { [key: string]: typeof englishTranslations } = {
|
||||
zoomIn: "Vergrößern",
|
||||
|
||||
repairApp: "App reparieren",
|
||||
clearAddresses: "Vorherige Verbindungen löschen",
|
||||
clearCategories: "Vorschläge für Objektkategorien löschen",
|
||||
clearStatuses: "Vorschläge für Objektstaten löschen",
|
||||
|
||||
// overview
|
||||
overview: "Übersicht",
|
||||
@@ -281,7 +290,7 @@ const allTranslations: { [key: string]: typeof englishTranslations } = {
|
||||
|
||||
serverAddress: "Serveradresse",
|
||||
serverAddressPlaceholder: "wss://192.168.0.69:3000",
|
||||
previousConnections: "Vorherige Adressen",
|
||||
previousConnections: "Vorherige Verbindungen",
|
||||
|
||||
connectToServer: "Verbinden",
|
||||
disconnect: "Trennen",
|
||||
|
||||
Reference in New Issue
Block a user