This repository was archived by the owner on Aug 1, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-22
lines changed
Expand file tree Collapse file tree 1 file changed +8
-22
lines changed Original file line number Diff line number Diff line change 3131 export let view: " commits" | " discussion" ;
3232 export let patchCount: number ;
3333
34- let previousProject = project ;
35- let previousId = id ;
36- let previousPeerId = peerId ;
37-
3834 type PatchStatus =
3935 | { type: " loading" }
4036 | { type: " notReplicated" }
4642
4743 let patchStatus: PatchStatus = { type: " loading" };
4844
45+ $ : projectUrn = project .urn ;
4946 $ : {
50- // Show loading indicator if we wanna show a different patch.
51- if (
52- project .urn !== previousProject .urn ||
53- previousId !== id ||
54- previousPeerId !== peerId
55- ) {
56- patchStatus = { type: " loading" };
57- previousProject = project ;
58- previousId = id ;
59- previousPeerId = peerId ;
60- }
61- fetch (project , peerId , id );
47+ projectUrn ;
48+ id ;
49+ peerId ;
50+ patchStatus = { type: " loading" };
51+ fetch ();
6252 }
6353
6454 const fetchExecutor = mutexExecutor .create ();
65- async function fetch(
66- project : Project ,
67- peerId : string ,
68- id : string
69- ): Promise <void > {
55+ async function fetch(): Promise <void > {
7056 try {
7157 const result = await fetchExecutor .run (async () => {
7258 return await patch .getDetails (project , peerId , id );
9076 function watchPatchUpdates(): () => void {
9177 return localPeer .projectEvents .onValue (event => {
9278 if (event .urn .startsWith (project .urn )) {
93- fetch (project , peerId , id );
79+ fetch ();
9480 }
9581 });
9682 }
You can’t perform that action at this time.
0 commit comments