67 lines
1.6 KiB
TypeScript
67 lines
1.6 KiB
TypeScript
// Metro module 6141 (f6142).
|
|
import AuthenticationStore from "../../stores/AuthenticationStore";
|
|
import PoggermodeSettingsStore from "./PoggermodeSettingsStore";
|
|
import PoggermodeStore from "./PoggermodeStore";
|
|
import Dispatcher from "../../Dispatcher";
|
|
import trackPoggermodeSettingsUpdated from "./trackPoggermodeSettingsUpdated";
|
|
export function updatePoggermodeSettings(a0) {
|
|
Dispatcher.dispatch({
|
|
type: "POGGERMODE_SETTINGS_UPDATE",
|
|
settings: a0
|
|
});
|
|
trackPoggermodeSettingsUpdated({
|
|
...PoggermodeSettingsStore.getState(),
|
|
...a0
|
|
});
|
|
}
|
|
export function updateCombo(a0) {
|
|
Dispatcher.dispatch({
|
|
type: "POGGERMODE_UPDATE_COMBO",
|
|
...a0
|
|
});
|
|
}
|
|
export function clearMessageCombo(a0) {
|
|
Dispatcher.dispatch({
|
|
type: "POGGERMODE_UPDATE_MESSAGE_COMBO",
|
|
comboMessage: {
|
|
...a0,
|
|
displayed: true
|
|
}
|
|
});
|
|
}
|
|
export function updateComboOnMessageSend(a0, a1) {
|
|
const id = AuthenticationStore.getId();
|
|
const userCombo = PoggermodeStore.getUserCombo(id, a0);
|
|
if (userCombo != null) {
|
|
Dispatcher.dispatch({
|
|
type: "POGGERMODE_UPDATE_MESSAGE_COMBO",
|
|
comboMessage: {
|
|
combo: userCombo,
|
|
channelId: a0,
|
|
messageId: a1,
|
|
displayed: false
|
|
}
|
|
});
|
|
}
|
|
const r21 = userCombo != null;
|
|
let multiplier = 1;
|
|
if (r21) {
|
|
const r25 = userCombo?.value > 0;
|
|
multiplier = 1;
|
|
if (r25) {
|
|
let r27 = userCombo?.multiplier;
|
|
if (r27 == null) {
|
|
r27 = 0;
|
|
}
|
|
multiplier = r27 + 1;
|
|
}
|
|
}
|
|
Dispatcher.dispatch({
|
|
type: "POGGERMODE_UPDATE_COMBO",
|
|
channelId: a0,
|
|
userId: id,
|
|
multiplier,
|
|
value: 0
|
|
});
|
|
}
|