66 lines
2.1 KiB
TypeScript
66 lines
2.1 KiB
TypeScript
// Metro module 4204 (f4205).
|
|
import AuthenticationStore from "./AuthenticationStore";
|
|
import Module589 from "../_bundle/Module589";
|
|
import Module12 from "../_bundle/Module12";
|
|
import Dispatcher from "../Dispatcher";
|
|
let c2424_3, c2424_4;
|
|
const handleUpdate = function handleUpdate(a0) {
|
|
c2424_4 = {};
|
|
a0.sessions.forEach((session) => {
|
|
c2424_4[session.sessionId] = session;
|
|
});
|
|
};
|
|
c2424_3 = Object.freeze([]);
|
|
c2424_4 = {};
|
|
class SessionsStore extends Module589.Store {
|
|
static displayName = "SessionsStore";
|
|
initialize() {
|
|
this.waitFor(AuthenticationStore);
|
|
}
|
|
getSessions() {
|
|
return c2424_4;
|
|
}
|
|
getSession() {
|
|
const sessionId4 = AuthenticationStore.getSessionId();
|
|
return sessionId4 != null ? this.getSessionById(sessionId4) : null;
|
|
}
|
|
getRemoteActivities() {
|
|
const sessionId = AuthenticationStore.getSessionId();
|
|
const r13 = Module12.find(c2424_4, (a0) => a0.active && a0.sessionId !== sessionId);
|
|
return r13 != null ? r13.activities : c2424_3;
|
|
}
|
|
getHiddenActivities() {
|
|
const sessionId2 = AuthenticationStore.getSessionId();
|
|
const r13 = Module12.find(c2424_4, (a0) => a0.active && a0.sessionId !== sessionId2);
|
|
return r13 != null && r13.hiddenActivities != null ? r13.hiddenActivities : c2424_3;
|
|
}
|
|
getSessionById(a0) {
|
|
return c2424_4[a0];
|
|
}
|
|
getActiveSession() {
|
|
return Module12.find(c2424_4, (a0) => a0.active);
|
|
}
|
|
getRemoteApplicationActivity(a0) {
|
|
let c13975_0 = a0;
|
|
if (a0 == null) {
|
|
return null;
|
|
}
|
|
const sessionId3 = AuthenticationStore.getSessionId();
|
|
const r16 = Module12.find(c2424_4, (a0) => a0.active && a0.sessionId !== sessionId3);
|
|
if (r16 == null) {
|
|
return null;
|
|
}
|
|
let r20 = r16.activities.find((activity) => activity.application_id === c13975_0);
|
|
if (r20 == null) {
|
|
const hiddenActivities = r16.hiddenActivities;
|
|
r20 = hiddenActivities == null ? void 0 : hiddenActivities.find((hiddenActivity) => hiddenActivity.application_id === c13975_0);
|
|
}
|
|
return r20;
|
|
}
|
|
}
|
|
const sessionsStore = new SessionsStore(Dispatcher, {
|
|
CONNECTION_OPEN: handleUpdate,
|
|
SESSIONS_REPLACE: handleUpdate
|
|
});
|
|
export default sessionsStore;
|