Skip to content

Commit

Permalink
leanInfoUpdates
Browse files Browse the repository at this point in the history
  • Loading branch information
lbwexler committed Jan 2, 2025
1 parent 51f6a29 commit 3cb200e
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions desktop/cmp/viewmanager/dialog/ViewPanelModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ export class ViewPanelModel extends HoistModel {

async saveAsync() {
const {parent, view, formModel} = this,
{name, group, description, isDefaultPinned, isShared} = formModel.getData(true),
updates = formModel.getData(true),
isValid = await formModel.validateAsync(),
isDirty = formModel.isDirty;

if (!isValid || !isDirty) return;

if (view.isOwned && !isUndefined(isShared)) {
const msg: ReactNode = !isShared
if (view.isOwned && !isUndefined(updates.isShared)) {
const msg: ReactNode = !updates.isShared
? `Your ${view.typedName} will no longer be visible to all other ${XH.appName} users.`
: `Your ${view.typedName} will become visible to all other ${XH.appName} users.`;
const msgs = [msg, strong('Are you sure you want to proceed?')];
Expand All @@ -79,13 +79,7 @@ export class ViewPanelModel extends HoistModel {
if (!confirmed) return;
}

await parent.updateAsync(view, {
name,
group,
description,
isShared,
isDefaultPinned
});
await parent.updateAsync(view, updates);
}

//------------------------
Expand Down

0 comments on commit 3cb200e

Please sign in to comment.