Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: do not open changelog if not needed #556

Merged
merged 3 commits into from
Apr 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Extensions/combined/ryd.background.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ api.runtime.onMessage.addListener((request, sender, sendResponse) => {
}
});

api.runtime.onInstalled.addListener((details) => {
if (
// No need to show changelog if its was a browser update (and not extension update)
details.reason === "browser_update" ||
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual fix for #555.

// No need to show changelog if developer just reloaded the extension
(details.reason === "update" &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for when developer clicks "reload" button on chrome://extensions/.

details.previousVersion === chrome.runtime.getManifest().version)
)
return;
api.tabs.create({url: api.runtime.getURL("/changelog/3/changelog_3.0.html")});
})

// api.storage.sync.get(['lastShowChangelogVersion'], (details) => {
// if (extConfig.showUpdatePopup === true &&
// details.lastShowChangelogVersion !== chrome.runtime.getManifest().version
Expand All @@ -84,6 +96,7 @@ api.runtime.onMessage.addListener((request, sender, sendResponse) => {
// }
// });


async function sendVote(videoId, vote) {
api.storage.sync.get(null, async (storageResult) => {
if (!storageResult.userId || !storageResult.registrationConfirmed) {
Expand Down