Skip to content

Commit

Permalink
fix migration issue
Browse files Browse the repository at this point in the history
  • Loading branch information
schlawg committed Jan 11, 2025
1 parent 6c049fa commit 242a9fa
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions ui/local/src/dev/editDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,20 +155,13 @@ export class EditDialog {
private async push() {
const err = await env.push.pushBot(this.bot);
if (err) return alert(err);
// is needed?
// delete this.scratch[this.uid];
this.update();
}

private save() {
private async save() {
const behaviorScroll = this.view.querySelector('.behavior')!.scrollTop;
const filtersScroll = this.view.querySelector('.filters')!.scrollTop;
// for (const id of this.bot.disabled) removeObjectProperty({ obj: this.bot, path: { id } }, true);
// this.bot.disabled.clear();
// i wonder if this commented out stuff was needed?
env.bot.save(deadStrip(this.bot));
//delete this.scratch[this.uid];
//this.selectBot();
await env.bot.save(deadStrip(this.bot));
this.update();
this.view.querySelector('.behavior')!.scrollTop = behaviorScroll ?? 0;
this.view.querySelector('.filters')!.scrollTop = filtersScroll ?? 0;
Expand Down Expand Up @@ -335,8 +328,9 @@ export class EditDialog {
...(JSON.parse(view.querySelector<HTMLTextAreaElement>('.json')!.value) as BotInfo),
version,
};
this.scratch[this.uid] = Object.defineProperty(new Bot(newBot), 'disabled', {
value: new Set<string>(),
this.scratch[this.uid] = Object.defineProperties(new Bot(newBot), {
disabled: { value: new Set<string>() },
viewing: { value: new Map<string, string>() },
}) as WritableBot;
this.makeEditView();
this.update();
Expand Down

0 comments on commit 242a9fa

Please sign in to comment.