File tree Expand file tree Collapse file tree 4 files changed +18
-15
lines changed Expand file tree Collapse file tree 4 files changed +18
-15
lines changed Original file line number Diff line number Diff line change 137
137
}
138
138
139
139
const commitShortSha = commit .id .substring (0 , 7 );
140
- const authorImgUrl =
141
- commit .author .email ?.toLowerCase () === $user ?.email ?.toLowerCase ()
140
+ const authorImgUrl = $derived . by (() => {
141
+ return commit .author .email ?.toLowerCase () === $user ?.email ?.toLowerCase ()
142
142
? $user ?.picture
143
143
: commit .author .gravatarUrl ;
144
+ });
144
145
145
146
function handleUncommit(e : MouseEvent ) {
146
147
e .stopPropagation ();
Original file line number Diff line number Diff line change 42
42
43
43
let initialFiles = $state <[RemoteFile , ConflictEntryPresence | undefined ][]>([]);
44
44
let commit = $state <Commit | undefined >(undefined );
45
- let authorImgUrl = $state <string | undefined >(undefined );
45
+ const authorImgUrl = $derived .by (() => {
46
+ if (commit ) {
47
+ return commit .author .email ?.toLowerCase () === $user ?.email ?.toLowerCase ()
48
+ ? $user ?.picture
49
+ : commit .author .gravatarUrl ;
50
+ }
51
+ return undefined ;
52
+ });
46
53
47
54
let filesList = $state <HTMLDivElement | undefined >(undefined );
48
55
let contextMenu = $state <ReturnType <typeof FileContextMenu > | undefined >(undefined );
59
66
});
60
67
});
61
68
62
- $effect (() => {
63
- if (commit ) {
64
- authorImgUrl =
65
- commit .author .email ?.toLowerCase () === $user ?.email ?.toLowerCase ()
66
- ? $user ?.picture
67
- : commit .author .gravatarUrl ;
68
- }
69
- });
70
-
71
69
interface FileEntry {
72
70
name: string ;
73
71
path: string ;
Original file line number Diff line number Diff line change 96
96
if (ownedByUser ) {
97
97
const name = (await gitConfigService .get (' user.name' )) || unknownName ;
98
98
const email = (await gitConfigService .get (' user.email' )) || unknownEmail ;
99
- const srcUrl = $user ?.picture ? $user ?.picture : await gravatarUrlFromEmail (email );
99
+ const srcUrl =
100
+ email .toLowerCase () === $user ?.email ?.toLowerCase ()
101
+ ? $user ?.picture
102
+ : await gravatarUrlFromEmail (email );
100
103
101
104
avatars = [{ name , srcUrl }];
102
105
} else if (branchListingDetails ) {
Original file line number Diff line number Diff line change 19
19
const userService = getContext (UserService );
20
20
const user = userService .user ;
21
21
22
- const authorImgUrl =
23
- pullRequest .author ?.email ?.toLowerCase () === $user ?.email ?.toLowerCase ()
22
+ const authorImgUrl = $derived . by (() => {
23
+ return pullRequest .author ?.email ?.toLowerCase () === $user ?.email ?.toLowerCase ()
24
24
? $user ?.picture
25
25
: pullRequest .author ?.gravatarUrl ;
26
+ });
26
27
27
28
function onMouseDown() {
28
29
goto (formatPullRequestURL (project , pullRequest .number ));
You can’t perform that action at this time.
0 commit comments