Skip to content

Commit

Permalink
fix(background): regression. mistakenly added new code
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed Jun 17, 2018
1 parent 3cc2ec2 commit f974c61
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/background/context-menus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { getAppConfig } from '@/_helpers/config-manager'
// import { mergeMap, filter, map, audit, mapTo, share, startWith } from 'rxjs/operators'
import { Observable } from 'rxjs/Observable'
import { ReplaySubject } from 'rxjs/ReplaySubject'
import { fromPromise } from 'rxjs/observable/fromPromise'
import { merge } from 'rxjs/observable/merge'
import { combineLatest } from 'rxjs/observable/combineLatest'
import { mergeMap } from 'rxjs/operators/mergeMap'
import { filter } from 'rxjs/operators/filter'
Expand Down Expand Up @@ -81,12 +79,7 @@ browser.contextMenus.onClicked.addListener(info => {
export function init (initConfig: ContextMenusConfig): Observable<void> {
if (setMenus$$) { return setMenus$$ }
// when context menus config changes
const contextMenusChanged$ = merge(
fromPromise(getAppConfig().then<StorageUpdate<AppConfig>>(
config => ({ newValue: config })
)),
storage.createStream<AppConfig>('config'),
).pipe(
const contextMenusChanged$ = storage.createStream<AppConfig>('config').pipe(
filter((config): config is StorageUpdate<AppConfig> => {
const { newValue, oldValue } = config
if (!newValue) { return false }
Expand Down

0 comments on commit f974c61

Please sign in to comment.