Skip to content

Commit

Permalink
Relax disabling save in CustomWidgetGallery
Browse files Browse the repository at this point in the history
  • Loading branch information
georgegevoian committed Nov 26, 2024
1 parent a354760 commit 5e9b657
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions app/client/ui/CustomWidgetGallery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,10 @@ class CustomWidgetGallery extends Disposable {
}
});

this._saveDisabled = Computed.create(this, use => {
const selectedWidgetId = use(this._selectedWidgetId);
if (!selectedWidgetId) { return true; }
if (!this._section) { return false; }

const savedWidgetId = use(this._savedWidgetId);
if (selectedWidgetId === CUSTOM_URL_WIDGET_ID) {
return (
use(this._savedWidgetId) === CUSTOM_URL_WIDGET_ID &&
use(this._customUrl) === use(this._section.customDef.url)
);
} else {
return selectedWidgetId === savedWidgetId;
}
});
this._saveDisabled = Computed.create(
this,
(use) => !use(this._selectedWidgetId)
);

this._initializeWidgets().catch(reportError);

Expand Down

0 comments on commit 5e9b657

Please sign in to comment.