@sprucelabs/heartwood-view-controllers 112.3.3 → 112.3.6
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/README.md
CHANGED
|
@@ -18,5 +18,4 @@ Spruce XP Documentation
|
|
|
18
18
|
<a href="https://developer.spruce.ai/#/"><img width="250" src="https://raw.githubusercontent.com/sprucelabsai/heartwood-view-controllers/master/docs/images/read-full-docs.png" /></a>
|
|
19
19
|
</p>
|
|
20
20
|
### Dependencies
|
|
21
|
-
|
|
22
21
|
[Arkit diagram here](docs/dependencies.md).
|
|
@@ -42,6 +42,9 @@ class AuthenticatorImpl {
|
|
|
42
42
|
return !!this.getSessionToken();
|
|
43
43
|
}
|
|
44
44
|
clearSession() {
|
|
45
|
+
if (!this.isLoggedIn()) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
45
48
|
const person = JSON.parse(this.storage.getItem('person') ?? '{}');
|
|
46
49
|
this.eventEmitter.emit('will-logout', { person });
|
|
47
50
|
this.storage.removeItem('sessionToken');
|
|
@@ -40,6 +40,9 @@ export default class AuthenticatorImpl {
|
|
|
40
40
|
}
|
|
41
41
|
clearSession() {
|
|
42
42
|
var _a;
|
|
43
|
+
if (!this.isLoggedIn()) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
43
46
|
const person = JSON.parse((_a = this.storage.getItem('person')) !== null && _a !== void 0 ? _a : '{}');
|
|
44
47
|
this.eventEmitter.emit('will-logout', { person });
|
|
45
48
|
this.storage.removeItem('sessionToken');
|
|
@@ -947,7 +947,21 @@ const vcAssert = {
|
|
|
947
947
|
return this.assertControllerInstanceOf(model.controller, Class);
|
|
948
948
|
}
|
|
949
949
|
catch (_d) {
|
|
950
|
-
assert.fail(`Expected your ${(_c = (_b = (_a = Object.getPrototypeOf(vc)) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : 'view controller'} to render a controller that is an instance of ${Class.name}, but it didn't
|
|
950
|
+
assert.fail(`Expected your ${(_c = (_b = (_a = Object.getPrototypeOf(vc)) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : 'view controller'} to render a controller that is an instance of ${Class.name}, but it didn't! Make sure the view you're expecting is rendering itself as the controller (or another view controller). e.g.
|
|
951
|
+
|
|
952
|
+
1. Rendering a SubView:
|
|
953
|
+
|
|
954
|
+
public render() {
|
|
955
|
+
return this.cardVc.render()
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
3. Rendering as yourself (e.g. in a SkillViewController):
|
|
959
|
+
|
|
960
|
+
public render() {
|
|
961
|
+
return {
|
|
962
|
+
controller: this
|
|
963
|
+
}
|
|
964
|
+
} `);
|
|
951
965
|
}
|
|
952
966
|
return {};
|
|
953
967
|
},
|
|
@@ -900,7 +900,21 @@ const vcAssert = {
|
|
|
900
900
|
}
|
|
901
901
|
catch {
|
|
902
902
|
test_utils_1.assert.fail(`Expected your ${Object.getPrototypeOf(vc)?.constructor?.name ??
|
|
903
|
-
'view controller'} to render a controller that is an instance of ${Class.name}, but it didn't
|
|
903
|
+
'view controller'} to render a controller that is an instance of ${Class.name}, but it didn't! Make sure the view you're expecting is rendering itself as the controller (or another view controller). e.g.
|
|
904
|
+
|
|
905
|
+
1. Rendering a SubView:
|
|
906
|
+
|
|
907
|
+
public render() {
|
|
908
|
+
return this.cardVc.render()
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
3. Rendering as yourself (e.g. in a SkillViewController):
|
|
912
|
+
|
|
913
|
+
public render() {
|
|
914
|
+
return {
|
|
915
|
+
controller: this
|
|
916
|
+
}
|
|
917
|
+
} `);
|
|
904
918
|
}
|
|
905
919
|
return {};
|
|
906
920
|
},
|
package/package.json
CHANGED