- Replace separate bank/ATM pages with a unified `index.html` app bundle - Split bank init into `initClass`, `initSessionService`, and `initUIBridge` - Route UI events through `BankUIBridge` and refresh session payloads after sync
34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
#include "script_component.hpp"
|
|
|
|
if (isNil QGVAR(BankClass)) then { call FUNC(initClass); };
|
|
if (isNil QGVAR(BankSessionService)) then { call FUNC(initSessionService); };
|
|
if (isNil QGVAR(BankUIBridge)) then { call FUNC(initUIBridge); };
|
|
|
|
[QGVAR(initBank), {
|
|
GVAR(BankClass) call ["init", []];
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(responseInitBank), {
|
|
params [["_data", createHashMap, [createHashMap]]];
|
|
|
|
GVAR(BankClass) call ["sync", [_data, true]];
|
|
if !(isNil QGVAR(BankUIBridge)) then {
|
|
GVAR(BankUIBridge) call ["refreshSession", []];
|
|
};
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(responseSyncBank), {
|
|
params [["_data", createHashMap, [createHashMap]], ["_jip", false, [false]]];
|
|
|
|
GVAR(BankClass) call ["sync", [_data, _jip]];
|
|
if !(isNil QGVAR(BankUIBridge)) then {
|
|
GVAR(BankUIBridge) call ["refreshSession", []];
|
|
};
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[{
|
|
EGVAR(org,OrgClass) get "isLoaded";
|
|
}, {
|
|
[QGVAR(initBank), []] call CFUNC(localEvent);
|
|
}] call CFUNC(waitUntilAndExecute);
|