161 lines
4.7 KiB
TypeScript
161 lines
4.7 KiB
TypeScript
// Module ID: 15076
|
|
// Function ID: 15077
|
|
// Name: _fetchActiveChannels
|
|
// Dependencies: [5, 676, 709, 530, 4093, 2]
|
|
// Exports: fetchActiveChannels
|
|
|
|
// Module 15076 (_fetchActiveChannels)
|
|
import set from "set";
|
|
import { Endpoints } from "ME";
|
|
|
|
const require = arg1;
|
|
function _fetchActiveChannels() {
|
|
const self = this;
|
|
const tmp = callback((arg0) => {
|
|
let closure_0 = arg0;
|
|
let closure_1 = arg1;
|
|
let c7 = 0;
|
|
let c8 = 0;
|
|
let c6 = 0;
|
|
const iter = (function*(arg0) {
|
|
if (c8 === 2) {
|
|
c8 = 3;
|
|
HermesBuiltin.throwTypeError();
|
|
} else if (tmp6 === 3) {
|
|
if (arg0 === 1) {
|
|
throw arg1;
|
|
} else if (arg0 === 2) {
|
|
let obj = { value: null, done: true };
|
|
obj[0] = arg1;
|
|
return obj;
|
|
} else {
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} else {
|
|
try {
|
|
c8 = 2;
|
|
if (0 === c7) {
|
|
if (arg0 === 1) {
|
|
c8 = 3;
|
|
throw arg1;
|
|
} else if (arg0 === 2) {
|
|
c8 = 3;
|
|
obj = { value: null, done: true };
|
|
obj[0] = arg1;
|
|
return obj;
|
|
} else {
|
|
let closure_4 = tmp3;
|
|
let set = tmp7;
|
|
let num7;
|
|
if (num7 === undefined) {
|
|
num7 = 10;
|
|
}
|
|
let body;
|
|
set = undefined;
|
|
c7 = 1;
|
|
c8 = 1;
|
|
return { value: "ct", done: "Array" };
|
|
}
|
|
} else if (1 === tmp7) {
|
|
if (arg0 === 1) {
|
|
c8 = 3;
|
|
throw arg1;
|
|
} else if (arg0 === 2) {
|
|
c8 = 3;
|
|
const obj1 = { value: null, done: true };
|
|
obj1[0] = arg1;
|
|
return obj1;
|
|
} else {
|
|
const obj2 = { type: "ACTIVE_CHANNELS_FETCH_START", guildId: null };
|
|
obj2[1] = callback;
|
|
num7(body[2]).dispatch(obj2);
|
|
let c6 = 1;
|
|
const HTTP = callback(body[3]).HTTP;
|
|
const obj3 = { url: null, query: null, rejectWithError: true };
|
|
obj3[0] = closure_4.ACTIVE_CHANNELS(callback);
|
|
let obj4 = { channel_limit: null };
|
|
obj4[0] = num7;
|
|
obj3[1] = obj4;
|
|
c7 = 3;
|
|
c8 = 1;
|
|
const obj5 = { value: null, done: false };
|
|
obj5[0] = HTTP.get(obj3);
|
|
return obj5;
|
|
}
|
|
} else if (2 === tmp7) {
|
|
c6 = 0;
|
|
closure_4 = closure_5;
|
|
obj4 = num7(body[2]);
|
|
const obj6 = { type: "ACTIVE_CHANNELS_FETCH_FAILURE", guildId: null, error: null };
|
|
obj6[1] = callback;
|
|
const tmp29 = new num7(body[4])(closure_4);
|
|
obj6[2] = tmp29;
|
|
obj4.dispatch(obj6);
|
|
throw closure_4;
|
|
} else if (arg0 === 1) {
|
|
c8 = 3;
|
|
throw arg1;
|
|
} else if (arg0 === 2) {
|
|
c6 = 0;
|
|
c8 = 3;
|
|
const obj7 = { value: null, done: true };
|
|
obj7[0] = arg1;
|
|
return obj7;
|
|
} else {
|
|
body = arg1;
|
|
body = body.body;
|
|
let channels;
|
|
if (body != null) {
|
|
channels = body.channels;
|
|
}
|
|
body = channels;
|
|
if (channels == null) {
|
|
body = [];
|
|
}
|
|
set = body;
|
|
obj = num7(body[2]);
|
|
const obj8 = { type: "ACTIVE_CHANNELS_FETCH_SUCCESS", guildId: null, channels: null };
|
|
obj8[1] = callback;
|
|
obj8[2] = set;
|
|
obj.dispatch(obj8);
|
|
c6 = 0;
|
|
c8 = 3;
|
|
const obj9 = { value: null, done: true };
|
|
obj9[0] = body;
|
|
return obj9;
|
|
}
|
|
} catch (tmp34) {
|
|
closure_5 = tmp34;
|
|
if (tmp4 === c6) {
|
|
c8 = tmp2;
|
|
throw tmp34;
|
|
} else {
|
|
c7 = tmp;
|
|
}
|
|
}
|
|
}
|
|
})();
|
|
iter.next();
|
|
return iter;
|
|
});
|
|
const _fetchActiveChannels = tmp;
|
|
const apply = tmp.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
}
|
|
const result = require("dispatcher").fileFinishedImporting("modules/active_channels/ActiveChannelsActionCreators.tsx");
|
|
|
|
export const fetchActiveChannels = function fetchActiveChannels(arg0) {
|
|
const self = this;
|
|
const apply = _fetchActiveChannels.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
};
|