63 lines
1.6 KiB
TypeScript
63 lines
1.6 KiB
TypeScript
// Metro module 12810 (f12811).
|
|
import { Storage } from "../_bundle/Module595";
|
|
import Module589 from "../_bundle/Module589";
|
|
import Dispatcher from "../Dispatcher";
|
|
let c8836_2 = "MaintenanceStore";
|
|
let incident = null;
|
|
let maintenance = null;
|
|
const id = null;
|
|
class MaintenanceStore extends Module589.Store {
|
|
static displayName = "MaintenanceStore";
|
|
initialize() {
|
|
id = Storage.get(c8836_2);
|
|
}
|
|
getIncident() {
|
|
return incident;
|
|
}
|
|
getScheduledMaintenance() {
|
|
let r14;
|
|
let r7 = maintenance?.scheduled_until;
|
|
if (r7 == null) {
|
|
r7 = maintenance?.scheduled_for;
|
|
}
|
|
L11: {
|
|
const r13 = maintenance != null;
|
|
r14 = null;
|
|
if (r13) {
|
|
const id2 = maintenance.id;
|
|
r14 = null;
|
|
if (id2 !== id) {
|
|
if (r7 != null) {
|
|
const r26 = Date.now() < new Date(r7).getTime();
|
|
r14 = null;
|
|
if (!r26) {
|
|
break L11;
|
|
}
|
|
}
|
|
r14 = maintenance;
|
|
}
|
|
}
|
|
}
|
|
return r14;
|
|
}
|
|
}
|
|
const maintenanceStore = new MaintenanceStore(Dispatcher, {
|
|
CONNECTION_OPEN: function handleConnectionOpen() {
|
|
incident = null;
|
|
},
|
|
STATUS_PAGE_INCIDENT: function handleIncident(a0) {
|
|
incident = a0.incident;
|
|
},
|
|
STATUS_PAGE_SCHEDULED_MAINTENANCE: function handleScheduledMaintenance(a0) {
|
|
maintenance = a0.maintenance;
|
|
},
|
|
STATUS_PAGE_SCHEDULED_MAINTENANCE_ACK: function handleScheduledMaintenanceAck() {
|
|
if (maintenance == null) {
|
|
return false;
|
|
}
|
|
id = maintenance.id;
|
|
Storage.set(c8836_2, id);
|
|
}
|
|
});
|
|
export default maintenanceStore;
|