decord/source/modules/auth_sessions/AuthSessionsStore.tsx

57 lines
1.7 KiB
TypeScript
Raw Normal View History

// Module ID: 14785
// Function ID: 14786
// Name: AuthSessionsStore
// Dependencies: [504, 573, 2]
2026-07-23 10:11:24 +00:00
// Module 14785 (AuthSessionsStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
2026-07-20 16:05:17 +00:00
function handleInit() {
items = [];
2026-07-20 16:05:17 +00:00
}
let items = [];
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class AuthSessionsStore extends Store {
}
AuthSessionsStore.prototype["getSessions"] = function getSessions() {
return items;
2026-07-29 08:29:29 +00:00
};
AuthSessionsStore.displayName = "AuthSessionsStore";
const authSessionsStore = new AuthSessionsStore(DispatcherDefault, {
2026-07-20 16:05:17 +00:00
LOGOUT: handleInit,
LOGIN_SUCCESS: handleInit,
FETCH_AUTH_SESSIONS_SUCCESS: function handleFetchAuthSessionsSuccess(sessions) {
sessions = sessions.sessions;
items = sessions.map((approx_last_used_time) => {
2026-07-20 16:05:17 +00:00
const obj = {};
const merged = Object.assign(approx_last_used_time);
2026-07-29 08:29:29 +00:00
obj.approx_last_used_time = new Date(approx_last_used_time.approx_last_used_time);
2026-07-20 16:05:17 +00:00
return obj;
});
},
2026-07-29 08:29:29 +00:00
LOGOUT_AUTH_SESSIONS_SUCCESS: function handleLogoutAuthSessionsSuccess(arg0) {
items = undefined;
2026-07-23 10:11:24 +00:00
items = [...items];
2026-07-29 08:29:29 +00:00
c1 = false;
for (const item10014 of tmp) {
let tmp2 = (function _loop(item10014) {
closure_0 = item10014;
2026-07-29 08:29:29 +00:00
const findIndexResult = items.findIndex((id_hash) => id_hash.id_hash === closure_0);
if (findIndexResult >= 0) {
items.splice(findIndexResult, 1);
2026-08-24 06:08:38 +00:00
c1 = true;
2026-07-29 08:29:29 +00:00
}
})(item10014);
continue;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (!c1) {
2026-07-20 16:05:17 +00:00
return false;
}
}
});
const size = fn(2);
const result = size.fileFinishedImporting("modules/auth_sessions/AuthSessionsStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default authSessionsStore;