mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-02 02:41:22 +01:00
Removed old files, temporary disabled webpack because it was not working
This commit is contained in:
1 parent
f1daa81686
commit
1d33b7c5a2
30 files changed
+13935
-2115
No files matched your search
@@ -60,7 +60,8 @@ api.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
async function sendVote(videoId, vote) {
|
||||
api.storage.sync.get(null, async (storageResult) => {
|
||||
if (!storageResult.userId || !storageResult.registrationConfirmed) {
|
||||
register().then(() => sendVote(videoId, vote));
|
||||
await register();
|
||||
return;
|
||||
}
|
||||
fetch(`${apiUrl}/interact/vote`, {
|
||||
method: "POST",
|
||||
@@ -73,7 +74,14 @@ async function sendVote(videoId, vote) {
|
||||
value: vote,
|
||||
}),
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then(async (response) => {
|
||||
if (response.status == 401) {
|
||||
await register();
|
||||
await sendVote(videoId, vote);
|
||||
return;
|
||||
}
|
||||
return response.json()
|
||||
})
|
||||
.then((response) => {
|
||||
solvePuzzle(response).then((solvedPuzzle) => {
|
||||
fetch(`${apiUrl}/interact/confirmVote`, {
|
||||
@@ -123,7 +131,7 @@ function register() {
|
||||
}
|
||||
|
||||
api.storage.sync.get(null, (res) => {
|
||||
if (!res.userId || !res.registrationConfirmed) {
|
||||
if (!res || !res.userId || !res.registrationConfirmed) {
|
||||
register();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user