Skip to content

Commit

Permalink
Fix some more dumb initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
nickhall committed Apr 23, 2015
1 parent c9916d8 commit 5907a0d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions user.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @include https://soitgo.es/
// @include https://soitgo.es/?*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
// @version 1.2.0
// @version 1.2.1
// ==/UserScript==
$(document).ready(function()
{
Expand All @@ -19,7 +19,6 @@ var easycopy = {
init: function()
{
easycopy.loadSettings();
if (easycopy.settings['run'] !== true) easycopy.runFirstTime(); // Run first time only
console.log(easycopy.settings);

// Add x and + links
Expand Down Expand Up @@ -224,6 +223,11 @@ var easycopy = {
loadSettings: function()
{
var settings = GM_listValues();
if (settings.length === 0)
{
easycopy.runFirstTime(); // Run if we haven't saved anything yet
settings = GM_listValues(); // Reload
}
for (var i = 0; i < settings.length; i++)
{
easycopy.settings[settings[i]] = GM_getValue(settings[i]);
Expand All @@ -233,7 +237,6 @@ var easycopy = {
runFirstTime: function()
{
console.log('Running initial setup...')
GM_setValue('run', true);
console.log('Defaulting link box display to true');
GM_setValue('showLinkBox', true);
}
Expand Down

0 comments on commit 5907a0d

Please sign in to comment.