@xh/hoist 75.0.0-SNAPSHOT.1754347635253 → 75.0.0-SNAPSHOT.1754604038542

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "75.0.0-SNAPSHOT.1754347635253",
3
+ "version": "75.0.0-SNAPSHOT.1754604038542",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",
@@ -95,27 +95,25 @@ export class IdentityService extends HoistService {
95
95
  !this.canAuthUserImpersonate,
96
96
  'User does not have right to impersonate or impersonation is disabled.'
97
97
  );
98
- return XH.fetchJson({
98
+ await XH.prefService.pushPendingAsync();
99
+ await XH.fetchJson({
99
100
  url: 'xh/impersonate',
100
101
  params: {
101
102
  username: username
102
103
  }
103
- }).then(() => {
104
- XH.reloadApp();
105
104
  });
105
+ XH.reloadApp();
106
106
  }
107
107
 
108
108
  /** Exit any active impersonation, reloading the app to resume accessing it as yourself. */
109
109
  async endImpersonateAsync() {
110
- return XH.fetchJson({
111
- url: 'xh/endImpersonate'
112
- })
113
- .then(() => {
114
- XH.reloadApp();
115
- })
116
- .catchDefault({
117
- message: 'Failed to end impersonation'
118
- });
110
+ try {
111
+ await XH.prefService.pushPendingAsync();
112
+ await XH.fetchJson({url: 'xh/endImpersonate'});
113
+ XH.reloadApp();
114
+ } catch (e) {
115
+ XH.handleException(e, {message: 'Failed to end impersonation'});
116
+ }
119
117
  }
120
118
 
121
119
  //------------------------