Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
apply patch
Browse files Browse the repository at this point in the history
  • Loading branch information
SergNikitin committed Jan 19, 2023
1 parent d081970 commit 42b80c5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions archaeologist/src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ import {
NodeUtil,
TotalUserActivity,
ResourceVisit,
makeDatacenterStorageApi,
UserExternalPipelineId,
NodeCreatedVia,
UserExternalPipelineIngestionProgress,
StorageApi,
steroid,
} from 'smuggler-api'

import { makeBrowserExtStorageApi } from './storage_api_browser_ext'
import { isReadyToBeAutoSaved } from './background/pageAutoSaving'
import { suggestAssociations } from './background/suggestAssociations'
import { isMemorable } from './content/extractor/url/unmemorable'
Expand Down Expand Up @@ -902,7 +902,7 @@ browser.contextMenus.onClicked.addListener(
}
)

const storage: StorageApi = makeDatacenterStorageApi()
const storage: StorageApi = makeBrowserExtStorageApi(browser.storage.local)

auth.register()
browserBookmarks.register(storage)
Expand Down
5 changes: 3 additions & 2 deletions archaeologist/src/content/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import browser from 'webextension-polyfill'
import { PostHog } from 'posthog-js'
import { v4 as uuidv4 } from 'uuid'

import { NodeUtil, NodeType, makeDatacenterStorageApi } from 'smuggler-api'
import { NodeUtil, NodeType } from 'smuggler-api'
import type { TNode, TNodeJson } from 'smuggler-api'
import { genOriginId, OriginIdentity, log, productanalytics } from 'armoury'
import * as truthsayer_archaeologist_communication from 'truthsayer-archaeologist-communication'

import { mazed } from '../util/mazed'

import { makeBrowserExtStorageApi } from './../storage_api_browser_ext'
import {
FromContent,
ToContent,
Expand Down Expand Up @@ -392,7 +393,7 @@ const App = () => {
<ContentContext.Provider
value={{
analytics: state.analytics,
storage: makeDatacenterStorageApi(),
storage: makeBrowserExtStorageApi(browser.storage.local),
}}
>
<BrowserHistoryImportControlPortal
Expand Down
6 changes: 4 additions & 2 deletions archaeologist/src/popup/PopUpApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { mazed } from '../util/mazed'
import { MdiLaunch } from 'elementary'
import { productanalytics } from 'armoury'
import { PopUpContext } from './context'
import { makeDatacenterStorageApi } from 'smuggler-api'
import { makeBrowserExtStorageApi } from './../storage_api_browser_ext'

const AppContainer = styled.div`
width: 340px;
Expand Down Expand Up @@ -74,7 +74,9 @@ export const PopUpApp = () => {

return (
<AppContainer>
<PopUpContext.Provider value={{ storage: makeDatacenterStorageApi() }}>
<PopUpContext.Provider
value={{ storage: makeBrowserExtStorageApi(browser.storage.local) }}
>
{state.userUid == null ? <LoginPage /> : <ViewActiveTabStatus />}
</PopUpContext.Provider>
</AppContainer>
Expand Down
8 changes: 5 additions & 3 deletions truthsayer/src/lib/global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { jcss } from 'elementary'
import {
createUserAccount,
AccountInterface,
makeDatacenterStorageApi,
makeAlwaysThrowingStorageApi,
} from 'smuggler-api'
import { makeMsgProxyStorageApi } from 'truthsayer-archaeologist-communication'
import type { StorageApi } from 'smuggler-api'

import styles from './global.module.css'
Expand Down Expand Up @@ -95,10 +95,12 @@ export function MzdGlobal(props: React.PropsWithChildren<MzdGlobalProps>) {
)

const [account, setAccount] = React.useState<AccountInterface | null>(null)
const [state] = React.useState<Omit<MzdGlobalState, 'account'>>({
const [storage, setStorage] = React.useState<StorageApi>(
makeStorageApi(defaultAppSettings)
)
const [state] = React.useState<Omit<MzdGlobalState, 'account' | 'storage'>>({
toaster: { push: pushToast },
analytics: props.analytics,
storage: makeDatacenterStorageApi(),
appSettings: defaultAppSettings,
})

Expand Down

0 comments on commit 42b80c5

Please sign in to comment.