72 lines
2.0 KiB
TypeScript
72 lines
2.0 KiB
TypeScript
// Metro module 15333 (f15334).
|
|
import { Endpoints } from "../../../Constants";
|
|
import { icymiEnabled } from "../ICYMIUtils";
|
|
import { HTTP } from "../../../_bundle/sendRequest";
|
|
import Dispatcher from "../../../Dispatcher";
|
|
import ToastActionCreators from "../../toast/native/ToastActionCreators";
|
|
import { intl, t } from "../../../intl/index.native";
|
|
const r18 = {
|
|
customScoreGuild: async ({ guildId, channelScores, guildScore }) => {
|
|
let c27994_0, c27994_2;
|
|
let c27994_3 = 0;
|
|
const r12 = void 0;
|
|
L15: {
|
|
try {
|
|
c27994_0 = r12;
|
|
if (icymiEnabled("customScores")) {
|
|
c27994_3 = 1;
|
|
await HTTP.put({
|
|
url: Endpoints.GRAVITY_CUSTOM_GUILD_SCORES,
|
|
body: {
|
|
guild_id: guildId,
|
|
channel_scores: channelScores == null ? void 0 : channelScores.map((channelScore) => ({
|
|
channel_id: channelScore.channelId,
|
|
score: channelScore.score
|
|
})),
|
|
guild_score: guildScore
|
|
},
|
|
rejectWithError: true
|
|
});
|
|
Dispatcher.dispatch({
|
|
type: "ICYMI_CUSTOM_SCORES_UPDATED",
|
|
guildId,
|
|
channelScores,
|
|
guildScore
|
|
});
|
|
ToastActionCreators.open({
|
|
key: "GravityGuildScore",
|
|
content: intl.string(t.OMdbs1)
|
|
});
|
|
c27994_3 = 0;
|
|
break L15;
|
|
}
|
|
} catch ($e) {
|
|
const r30 = $e;
|
|
let r8 = r30;
|
|
c27994_2 = r30;
|
|
if (c27994_3 !== 0) {
|
|
while (true) {
|
|
try {
|
|
c27994_3 = 0;
|
|
ToastActionCreators.open({
|
|
key: "GravityGuildScore",
|
|
content: intl.string(t.CG4Hks)
|
|
});
|
|
break L15;
|
|
} catch (r104) {
|
|
r8 = r104;
|
|
c27994_2 = r104;
|
|
if (c27994_3 === 0) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
throw r8;
|
|
}
|
|
return void 0;
|
|
}
|
|
}
|
|
};
|
|
export default r18;
|