Rename renderProfileCollections -> renderProfileCollection
This commit is contained in:
parent
591c054d59
commit
19b6d56963
5 changed files with 10 additions and 10 deletions
|
|
@ -197,7 +197,7 @@ export const startPlugin = traceFunction("startPlugin", function startPlugin(p:
|
|||
onBeforeMessageEdit, onBeforeMessageSend, onMessageClick,
|
||||
renderChatBarButton, chatBarButton, renderMemberListDecorator, renderMessageAccessory, renderMessageDecoration, renderMessagePopoverButton, messagePopoverButton,
|
||||
// Custom
|
||||
renderNicknameIcon, headerBarButton, audioProcessor, userAreaButton, renderProfileCollections
|
||||
renderNicknameIcon, headerBarButton, audioProcessor, userAreaButton, renderProfileCollection
|
||||
} = p;
|
||||
|
||||
if (p.start) {
|
||||
|
|
@ -268,7 +268,7 @@ export const startPlugin = traceFunction("startPlugin", function startPlugin(p:
|
|||
}
|
||||
if (audioProcessor) addAudioProcessor(name, audioProcessor);
|
||||
if (userAreaButton) addUserAreaButton(name, userAreaButton.render, userAreaButton.priority);
|
||||
if (renderProfileCollections) addProfileCollection(name, renderProfileCollections, userAreaButton?.priority);
|
||||
if (renderProfileCollection) addProfileCollection(name, renderProfileCollection, userAreaButton?.priority);
|
||||
|
||||
return true;
|
||||
}, p => `startPlugin ${p.name}`);
|
||||
|
|
@ -279,7 +279,7 @@ export const stopPlugin = traceFunction("stopPlugin", function stopPlugin(p: Plu
|
|||
onBeforeMessageEdit, onBeforeMessageSend, onMessageClick,
|
||||
renderChatBarButton, chatBarButton, renderMemberListDecorator, renderMessageAccessory, renderMessageDecoration, renderMessagePopoverButton, messagePopoverButton,
|
||||
// Custom
|
||||
renderNicknameIcon, headerBarButton, audioProcessor, userAreaButton, renderProfileCollections
|
||||
renderNicknameIcon, headerBarButton, audioProcessor, userAreaButton, renderProfileCollection
|
||||
} = p;
|
||||
|
||||
if (p.stop) {
|
||||
|
|
@ -344,7 +344,7 @@ export const stopPlugin = traceFunction("stopPlugin", function stopPlugin(p: Plu
|
|||
}
|
||||
if (audioProcessor) removeAudioProcessor(name);
|
||||
if (userAreaButton) removeUserAreaButton(name);
|
||||
if (renderProfileCollections) removeProfileCollection(name);
|
||||
if (renderProfileCollection) removeProfileCollection(name);
|
||||
|
||||
return true;
|
||||
}, p => `stopPlugin ${p.name}`);
|
||||
|
|
@ -357,7 +357,7 @@ export const initPluginManager = onlyOnce(function init() {
|
|||
"onBeforeMessageEdit", "onBeforeMessageSend", "onMessageClick",
|
||||
"renderChatBarButton", "renderMemberListDecorator", "renderMessageAccessory", "renderMessageDecoration", "renderMessagePopoverButton",
|
||||
// Custom
|
||||
"renderNicknameIcon", "renderProfileCollections"
|
||||
"renderNicknameIcon", "renderProfileCollection"
|
||||
];
|
||||
|
||||
const neededApiPlugins = new Set<string>();
|
||||
|
|
@ -399,7 +399,7 @@ export const initPluginManager = onlyOnce(function init() {
|
|||
if (p.headerBarButton) neededApiPlugins.add("HeaderBarAPI");
|
||||
if (p.audioProcessor) neededApiPlugins.add("AudioPlayerAPI");
|
||||
if (p.userAreaButton) neededApiPlugins.add("UserAreaAPI");
|
||||
if (p.renderProfileCollections) neededApiPlugins.add("ProfileCollectionsAPI");
|
||||
if (p.renderProfileCollection) neededApiPlugins.add("ProfileCollectionsAPI");
|
||||
|
||||
for (const key of pluginKeysToBind) {
|
||||
p[key] &&= p[key].bind(p) as any;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ export default definePlugin({
|
|||
}
|
||||
}
|
||||
],
|
||||
renderProfileCollections: ErrorBoundary.wrap((props: { user: User; displayProfile?: any; }) => {
|
||||
renderProfileCollection: ErrorBoundary.wrap((props: { user: User; displayProfile?: any; }) => {
|
||||
return (
|
||||
<ProfilePopoutComponent
|
||||
{...props}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,6 @@ export default definePlugin({
|
|||
useAuthorizationStore.persist.rehydrate();
|
||||
},
|
||||
|
||||
renderProfileCollections: ErrorBoundary.wrap(ProfileSongs, { noop: true }),
|
||||
renderProfileCollection: ErrorBoundary.wrap(ProfileSongs, { noop: true }),
|
||||
renderWidgetSongs: ErrorBoundary.wrap(WidgetSongs, { noop: true }),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ export default definePlugin({
|
|||
}, 4000);
|
||||
},
|
||||
|
||||
renderProfileCollections: ErrorBoundary.wrap(({ user, isSideBar = false }: { user: User; isSideBar?: boolean; }) => {
|
||||
renderProfileCollection: ErrorBoundary.wrap(({ user, isSideBar = false }: { user: User; isSideBar?: boolean; }) => {
|
||||
const [reviewData] = useAwaiter(() => getReviews(user.id, { limit: 4 }), { deps: [user.id], fallbackValue: null });
|
||||
|
||||
// Discord are masters at using a crap ton of html elements and css classes to create a simple ui that could have
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ export interface PluginDef {
|
|||
headerBarButton?: HeaderBarButtonData;
|
||||
audioProcessor?: AudioProcessor;
|
||||
userAreaButton?: UserAreaButtonData;
|
||||
renderProfileCollections?: ProfileCollectionFactory;
|
||||
renderProfileCollection?: ProfileCollectionFactory;
|
||||
|
||||
// TODO: Remove eventually
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue