This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,51 @@
// Metro module 5949 (f5950).
import { Endpoints } from "../../Constants";
import { HTTP } from "../../_bundle/sendRequest";
import Dispatcher from "../../Dispatcher";
const r19 = {
fetch: async () => {
let c25658_3 = 0;
let c29645_0;
L10: {
try {
c29645_0 = void 0;
c25658_3 = 1;
c29645_0 = await HTTP.get({
url: Endpoints.FRIEND_SUGGESTIONS,
rejectWithError: true
});
Dispatcher.dispatch({
type: "LOAD_FRIEND_SUGGESTIONS_SUCCESS",
suggestions: c29645_0.body
});
c25658_3 = 0;
} catch ($e) {
let r8 = $e;
if (c25658_3 !== 0) {
while (true) {
try {
c25658_3 = 0;
Dispatcher.dispatch({
type: "LOAD_FRIEND_SUGGESTIONS_FAILURE"
});
break L10;
} catch ($e) {
r8 = $e;
if (c25658_3 === 0) {
break;
}
}
}
}
throw r8;
}
}
},
ignore: (a0) => {
HTTP.del({
url: Endpoints.FRIEND_SUGGESTION(a0),
rejectWithError: true
});
}
};
export default r19;
@@ -0,0 +1,102 @@
// Metro module 5948 (f5949).
import UserRecord from "../../records/UserRecord";
import UserStore from "../../stores/UserStore";
import Module12 from "../../_bundle/Module12";
import FriendSuggestionActionCreators from "./FriendSuggestionActionCreators";
import maybeDispatchDevOnlyDummyFriendSuggestions from "./maybeDispatchDevOnlyDummyFriendSuggestions";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
function $mk77511() {
return (a0) => a0.key;
}
let $mk77510 = function() {
return (a0) => {
const contactNames = a0.contact_names != null && a0.contact_names.length >= 2 ? a0.contact_names.slice(0, 2) : [];
return {
key: a0.suggested_user.id,
name: Module12.first(a0.reasons)?.name,
user: new UserRecord(a0.suggested_user),
mutualFriendsCount: a0.mutual_friends_count,
contactNames
};
};
};
let c3741_4 = {};
let friendSuggestionCount = 0;
let c3741_6 = false;
let c3741_7 = false;
class FriendSuggestionStore extends Module589.Store {
static displayName = "FriendSuggestionStore";
initialize() {
this.waitFor(UserStore);
}
getSuggestionCount() {
return friendSuggestionCount;
}
getSuggestions() {
return Object.entries(c3741_4).map((item) => {
const [, r13] = item;
return r13;
});
}
getSuggestion(a0) {
return c3741_4[a0];
}
}
const friendSuggestionStore = new FriendSuggestionStore(Dispatcher, {
CONNECTION_OPEN: function handleConnectionOpen(a0) {
c3741_4 = {};
const friendSuggestionCount2 = a0.friendSuggestionCount;
friendSuggestionCount = friendSuggestionCount2;
if (friendSuggestionCount2 > 0) {
c3741_7 = true;
const r3 = c3741_6;
if (r3 ? !r3 : true) {
c3741_6 = true;
c3741_7 = false;
FriendSuggestionActionCreators.fetch();
}
} else {
maybeDispatchDevOnlyDummyFriendSuggestions();
}
},
FRIEND_SUGGESTION_CREATE: function handleFriendSuggestionCreate({ suggestion }) {
const contactNames = suggestion.contact_names != null && suggestion.contact_names.length >= 2 ? suggestion.contact_names.slice(0, 2) : [];
const r21 = {
key: suggestion.suggested_user.id,
name: Module12.first(suggestion.reasons)?.name,
user: new UserRecord(suggestion.suggested_user),
mutualFriendsCount: suggestion.mutual_friends_count,
contactNames
};
if (c3741_4[r21.key] != null) {
return false;
}
friendSuggestionCount = friendSuggestionCount + 1;
const r38 = {
...c3741_4
};
r38[r21.key] = r21;
c3741_4 = r38;
},
FRIEND_SUGGESTION_DELETE: function handleFriendSuggestionDelete(a0) {
const r5 = Math;
const r7 = friendSuggestionCount - 1;
friendSuggestionCount = r7;
friendSuggestionCount = r5.max(0, r7);
delete c3741_4[a0.suggestedUserId];
},
LOAD_FRIEND_SUGGESTIONS_SUCCESS: function handleLoadFriendSuggestionsSuccess(a0) {
c3741_6 = false;
c3741_4 = Module12.chain(a0.suggestions).map($mk77510()).keyBy($mk77511()).value();
friendSuggestionCount = Module12.keys(c3741_4).length;
},
LOAD_FRIEND_SUGGESTIONS_FAILURE: function handleLoadFriendSuggestionsFailure() {
c3741_6 = false;
c3741_4 = {};
}
});
export default friendSuggestionStore;
export function transformFriendSuggestions(a0) {
return Module12.chain(a0).map($mk77510()).keyBy($mk77511()).value();
}
@@ -0,0 +1,12 @@
// Metro module 15040 (f15041).
export function getSuggestedContactNameForSuggestion(a0, a1) {
const r11 = a1?.contactNames != null ? (a1 == null ? void 0 : a1.contactNames.length) >= 2 ? a1 == null ? void 0 : a1.contactNames.slice(0, 2).join(" ").trim() : void 0 : void 0;
if (r11 != null) {
if (a0 == null && r11 != null) {
return r11;
}
if (a0 != null && a0 !== r11 && a0.split(" ")[0] !== r11.split(" ")[0]) {
return r11;
}
}
}
@@ -0,0 +1,5 @@
// Metro module 5950 (f5951).
import UserStore from "../../stores/UserStore";
export default function maybeDispatchDevOnlyDummyFriendSuggestions(r4 = Number.MAX_VALUE) {
Math.min(Object.values(UserStore.getUsers()).length, r4);
};