File tree Expand file tree Collapse file tree 1 file changed +10
-19
lines changed
server/fishtest/templates Expand file tree Collapse file tree 1 file changed +10
-19
lines changed Original file line number Diff line number Diff line change 645645 }
646646
647647 const fetchDiffThreeDots = async (diffApiUrl) => {
648- try {
649- const token = localStorage.getItem("github_token");
650- const options = token
651- ? {
652- headers : {
653- Authorization : "Bearer " + token,
654- Accept : "application/vnd.github.diff",
655- },
656- }
657- : {
658- headers : {
659- Accept : "application/vnd.github.diff",
660- },
661- };
662- const text = await fetchText(diffApiUrl, options);
663- return {text : text, count: text?.split("\n")?.length || 0};
664- } catch(e) {
665- console.log("Error fetching diff : " + e);
666- return {text : "", count: 0};
648+ const token = localStorage.getItem("github_token");
649+ const options = {
650+ headers : {
651+ Accept : "application/vnd.github.diff",
652+ }
653+ }
654+ if (token) {
655+ headers.Authorization = "Bearer " + token;
667656 }
657+ const text = await fetchText(diffApiUrl, options);
658+ return {text : text, count: text?.split("\n")?.length || 0};
668659 };
669660
670661 function loadingButton() {
You can’t perform that action at this time.
0 commit comments