Timezones: Pass UserID to banner
This commit is contained in:
parent
8af167130e
commit
c1ae991073
1 changed files with 9 additions and 5 deletions
|
|
@ -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" />;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue