27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
// Metro module 8444 (f8445).
|
|
import { useEffect } from "react";
|
|
import DismissibleContentFrameworkStore from "./DismissibleContentFrameworkStore";
|
|
import { ContentDismissActionType } from "./DismissibleContentConstants";
|
|
import { CONTENT_TYPES_WITH_BYPASS_FATIGUE } from "./DismissibleContentFatigueConfig";
|
|
import { isGuildDismissibleContent } from "./DismissibleContentTypes";
|
|
export function useSelectedDismissibleContentShared(a0, a1) {
|
|
let r4 = arguments[2];
|
|
if (r4 === void 0) {
|
|
r4 = false;
|
|
}
|
|
const r7 = arguments[3];
|
|
let c16597_2 = r7;
|
|
const r10 = a0 != null && !r4 && !CONTENT_TYPES_WITH_BYPASS_FATIGUE.has(a0);
|
|
let c16597_3 = r10;
|
|
useEffect(() => () => {
|
|
let r4 = c16597_3;
|
|
if (r4) {
|
|
const content = DismissibleContentFrameworkStore.lastDismissed?.content;
|
|
r4 = content !== a0 || isGuildDismissibleContent(a0) && DismissibleContentFrameworkStore.lastDismissed?.guildId !== c16597_2;
|
|
}
|
|
if (r4) {
|
|
a1(ContentDismissActionType.AUTO_DISMISS, true);
|
|
}
|
|
}, [r10, a1, a0, r7]);
|
|
}
|