OverviewFilesCommitsIssuesDocsReleasesPeers

keet-deobfuscated / @holepunchto / keet-store / store / app / saga / app-update.saga.js

21 lines · javascript ref:
import { put as e } from "redux-saga/effects"
import { getCoreBackend as r } from "../../../backend"
import { taskError as o } from "../../error"
import { apiSubscribeLatest as t, apiSubscribeSaga as a } from "../../lib"
import { APP_UPDATE_REASONS as i } from "../app.constants"
import { setSystemUpdate as s, setUpdateRequired as n } from "../app.reducer"
export function* systemUpdateHandlerSaga() {
  yield a([r().subscribeSystemUpdateRequest], function* (r) {
    yield e(s(r))
  })
}
export function* forceUpdateHandlerSaga() {
  yield t(
    [r().subscribeForceUpdates],
    function* ({ showBanner: r }) {
      r && (yield e(n({ reason: i.APP_UPGRADE, timestamp: Date.now() })))
    },
    { onError: (r) => e(o("subscribeForceUpdates", r)) },
  )
}