Skip to content

Commit bbbc98b

Browse files
committed
fix: improve how the selection is changed
1 parent c065bb9 commit bbbc98b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

scripts/options.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
55
*/
66

7-
//TODO add enterprise login via management.
87
const PASSIVE_EVENT = {
9-
capturing: false,
10-
passive: true
11-
};
8+
capturing: false,
9+
passive: true
10+
},
11+
MIN_OAUTH_VERSION = 60;
1212

1313
class Account extends window.Storage {
1414
constructor(type, id, area, details = {}) {
@@ -99,12 +99,13 @@ class AccountManager extends window.StorageManager {
9999
browser.runtime.getBrowserInfo()
100100
.then(({ version }) => {
101101
const [ major ] = version.split('.');
102-
if(parseInt(major, 10) >= 60) {
102+
if(parseInt(major, 10) >= MIN_OAUTH_VERSION) {
103103
const disabledOptions = typeForm.querySelectorAll('option[disabled]');
104-
typeForm.querySelector('option[selected]').selected = false;
105104
for(const option of disabledOptions) {
106105
option.disabled = false;
107106
}
107+
// Default selection
108+
typeForm.value = "github";
108109
}
109110
})
110111
.catch(console.error);

0 commit comments

Comments
 (0)