Timezones: Pass UserID to banner

This commit is contained in:
thororen 2026-09-23 17:07:26 -04:00
parent 8af167130e
commit c1ae991073
No known key found for this signature in database

View file

@ -279,6 +279,13 @@ export default definePlugin({
patches: [
// stolen from ViewIcons
{
find: 'backgroundColor:"COMPLETE"===',
replacement: {
match: /bannerSrc:\i,(?=backgroundColor:"COMPLETE")/,
replace: "$&user:arguments[0].user,"
}
},
{
find: '"--custom-cutout-radius":',
replacement: {
@ -351,12 +358,9 @@ export default definePlugin({
getTime,
renderProfileTimezone: props => {
if (!settings.store.showProfileTime || !props?.bannerSrc) return null;
const match = /\/banners\/(\d+)\//.exec(props.bannerSrc);
const userId = match?.[1];
if (!userId) return null;
if (!settings.store.showProfileTime || !props?.user?.id) return null;
const userId = props.user.id;
if (userId === UserStore.getCurrentUser().id && !settings.store.showOwnTimezone) return null;
return <TimestampComponent userId={userId} type="profile" />;