Skip to content

Commit 2e57dee

Browse files
Merge pull request #5893 from Expensify/jasper-offlineWorkspaceSettings
Workspace Settings page - Fix offline behavior
2 parents c07ccc2 + 6163750 commit 2e57dee

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/pages/workspace/WorkspaceSettingsPage.js

+6-9
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,16 @@ class WorkspaceSettingsPage extends React.Component {
105105
}
106106

107107
submit() {
108-
Policy.updateLocalPolicyValues(this.props.policy.id, {isPolicyUpdating: true});
108+
const name = this.state.name.trim();
109+
const avatarURL = this.state.avatarURL;
110+
const outputCurrency = this.state.currency;
111+
Policy.updateLocalPolicyValues(this.props.policy.id, {name, avatarURL, outputCurrency});
109112

110113
// Wait for the upload avatar promise to finish before updating the policy
111114
this.uploadAvatarPromise.then(() => {
112-
const name = this.state.name.trim();
113-
const avatarURL = this.state.avatarURL;
114-
const policyID = this.props.policy.id;
115-
const currency = this.state.currency;
116-
117-
Policy.update(policyID, {name, avatarURL, outputCurrency: currency}, true);
118-
}).catch(() => {
119-
Policy.updateLocalPolicyValues(this.props.policy.id, {isPolicyUpdating: false});
115+
Policy.update(this.props.policy.id, {name, avatarURL, outputCurrency});
120116
});
117+
Growl.success(this.props.translate('workspace.common.growlMessageOnSave'));
121118
}
122119

123120
render() {

0 commit comments

Comments
 (0)