@robotical/webapp-types 3.7.31 → 3.7.33
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.
|
@@ -11,6 +11,7 @@ import { ConnectedRaftItem } from "../../store/SelectedRaftContext";
|
|
|
11
11
|
import Toaster from "../../utils/Toaster";
|
|
12
12
|
import AnalyticsFacade from "@robotical/appv2-analytics-gatherer";
|
|
13
13
|
import { CarouselNavigatorManager } from "../../utils/CarouselNavigatorManager";
|
|
14
|
+
import { UserDeviceInfo } from "../../types/userDeviceInfo";
|
|
14
15
|
export default class ApplicationManager {
|
|
15
16
|
AnalyticsFacade: typeof AnalyticsFacade;
|
|
16
17
|
analyticsSessionId: string | undefined;
|
|
@@ -22,6 +23,7 @@ export default class ApplicationManager {
|
|
|
22
23
|
connectedRaftsContext: ConnectedRaftItem[];
|
|
23
24
|
returnToMainApp: () => void;
|
|
24
25
|
carouselNavigatorManager: CarouselNavigatorManager;
|
|
26
|
+
deviceInfo: UserDeviceInfo | undefined;
|
|
25
27
|
private _router;
|
|
26
28
|
setRouter(router: any): void;
|
|
27
29
|
navigateTo(path: string): void;
|
|
@@ -37,6 +39,7 @@ export default class ApplicationManager {
|
|
|
37
39
|
};
|
|
38
40
|
isPhoneApp: () => boolean;
|
|
39
41
|
constructor();
|
|
42
|
+
getDeviceInfo(): Promise<void>;
|
|
40
43
|
updateRaftNameInAllStates(raftId: string, name: string): Promise<boolean>;
|
|
41
44
|
pauseWifiConnectionMarty(raftId: string, pause: boolean): Promise<boolean>;
|
|
42
45
|
getCachedWifiStatusMarty(martyId: string): RaftWifiConnStatus | undefined;
|
|
@@ -70,6 +70,8 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
70
70
|
this.returnToMainApp = function () { };
|
|
71
71
|
// Carousel navigators
|
|
72
72
|
this.carouselNavigatorManager = new CarouselNavigatorManager();
|
|
73
|
+
// Device info
|
|
74
|
+
this.deviceInfo = undefined;
|
|
73
75
|
// Callback to call when a RAFT is selected (Phone App only)
|
|
74
76
|
// We need that to make sure the connection button gets the selected RAFT once the user selects one
|
|
75
77
|
this.ricSelectedCb = null;
|
|
@@ -112,6 +114,21 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
112
114
|
Logger.error(SHOW_LOGS, TAG, "Router is not set");
|
|
113
115
|
}
|
|
114
116
|
};
|
|
117
|
+
ApplicationManager.prototype.getDeviceInfo = function () {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
119
|
+
var _a;
|
|
120
|
+
return __generator(this, function (_b) {
|
|
121
|
+
switch (_b.label) {
|
|
122
|
+
case 0:
|
|
123
|
+
_a = this;
|
|
124
|
+
return [4 /*yield*/, window.wrapperCommunicator.sendMessageAndWait(AppSentMessage.GET_DEVICE_INFO, {})];
|
|
125
|
+
case 1:
|
|
126
|
+
_a.deviceInfo = _b.sent();
|
|
127
|
+
return [2 /*return*/];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
};
|
|
115
132
|
ApplicationManager.prototype.updateRaftNameInAllStates = function (raftId, name) {
|
|
116
133
|
return __awaiter(this, void 0, void 0, function () {
|
|
117
134
|
var wasSuccessful;
|
|
@@ -111,6 +111,7 @@ export default function LEDLightsOrQRVerificationModal() {
|
|
|
111
111
|
}
|
|
112
112
|
function QRContent(_a) {
|
|
113
113
|
var _this = this;
|
|
114
|
+
var _b;
|
|
114
115
|
var setSerialNo = _a.setSerialNo;
|
|
115
116
|
var onQrCodeFound = function (result) { return __awaiter(_this, void 0, void 0, function () {
|
|
116
117
|
var rawValue, serialNo;
|
|
@@ -126,7 +127,8 @@ function QRContent(_a) {
|
|
|
126
127
|
return [2 /*return*/];
|
|
127
128
|
});
|
|
128
129
|
}); };
|
|
129
|
-
|
|
130
|
+
var isWebapp = ((_b = window.applicationManager.deviceInfo) === null || _b === void 0 ? void 0 : _b.manufacturer) === "Webapp";
|
|
131
|
+
return (_jsx("div", __assign({ className: styles.QRcontainer }, { children: _jsx("div", __assign({ className: styles.QRscannerContainer }, { children: _jsx(Scanner, { styles: { container: { transform: isWebapp ? 'scaleX(-1)' : 'none' } }, onError: function (err) { return console.error(err); }, formats: [
|
|
130
132
|
"qr_code",
|
|
131
133
|
"micro_qr_code",
|
|
132
134
|
"rm_qr_code",
|