Skip to content

Commit

Permalink
Options weren't working correctly, needed to prevent default even upo…
Browse files Browse the repository at this point in the history
…n form submit.
  • Loading branch information
Inirit committed Nov 23, 2017
1 parent 45f0483 commit 709a8a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions ts/options/ExtensionOptions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { HandlerType } from '../handlers/HandlerType';



export interface IExtensionOptions
{
HandlerType: HandlerType;
Expand All @@ -12,7 +10,7 @@ export interface IExtensionOptions
export class ExtensionOptions implements IExtensionOptions
{
private static readonly _defaultOptions: browser.storage.StorageObject = {
"HandlerType": HandlerType.Imgur
"HandlerType": `${HandlerType.Imgur}`
};

private readonly _currentOptions: browser.storage.StorageObject;
Expand Down Expand Up @@ -50,7 +48,7 @@ export class ExtensionOptions implements IExtensionOptions

set HandlerType(value: HandlerType)
{
this._currentOptions["HandlerType"] = value;
this._currentOptions["HandlerType"] = `${value}`;
}

get RawStorage(): browser.storage.StorageObject
Expand Down
4 changes: 3 additions & 1 deletion ts/options/OptionsMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import * as $ from 'jquery';

async function SaveOptions(e)
{
e.preventDefault();

const currentOptions = await ExtensionOptions.GetCurrentOptions();

currentOptions.HandlerType = $("#handlers").val() as number;
currentOptions.HandlerType = $("#handlers").val() as HandlerType;

await ExtensionOptions.UpdateCurrentOptions(currentOptions);
}
Expand Down

0 comments on commit 709a8a3

Please sign in to comment.