Skip to content

Commit d80e6ec

Browse files
authored
Update gitauth.js
1 parent 283696a commit d80e6ec

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

git/gitauth.js

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ window.onload = async () => {
1717
linkData = decodeLink(window.location.href);
1818

1919
// clear URL
20-
window.history.pushState(window.location.origin, 'Codeit', window.location.origin + '/full');
20+
window.history.replaceState(window.location.origin, 'Codeit', window.location.origin + '/full');
2121

2222

2323
// if treeLoc is in local storage
@@ -109,6 +109,35 @@ window.onload = async () => {
109109
}
110110

111111
})
112+
113+
// if git code exists in link
114+
if (linkData.gitCode) {
115+
116+
// hide intro screen
117+
sidebar.classList.remove('intro');
118+
119+
// if on safari, refresh header color
120+
if (isSafari) {
121+
122+
document.querySelector('meta[name="theme-color"]').content = '#313744';
123+
124+
onNextFrame(() => {
125+
126+
document.querySelector('meta[name="theme-color"]').content = '#1a1c24';
127+
128+
});
129+
130+
}
131+
132+
// start loading
133+
startLoading();
134+
135+
const gitCode = linkData.gitCode;
136+
137+
// get git token from Github
138+
getGithubToken(gitCode);
139+
140+
}
112141

113142

114143
loadLS();

0 commit comments

Comments
 (0)