This repository has been archived by the owner on Oct 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
add StorageApi impl which works via msgs #401
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SergNikitin
added
effort [XXS]
Up to 2 hours
impact [XXS]
archaeologist
truthsayer
labels
Jan 14, 2023
Test with From 25003863080f9951858be9d4ebfbdbd9927c017d Mon Sep 17 00:00:00 2001
From: Sergey Nikitin <snikitin@outlook.com>
Date: Sat, 14 Jan 2023 20:48:47 +0000
Subject: [PATCH] test
---
archaeologist/src/background.ts | 4 ++--
archaeologist/src/content/App.tsx | 5 +++--
archaeologist/src/popup/PopUpApp.tsx | 6 ++++--
truthsayer/src/lib/global.tsx | 4 ++--
4 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/archaeologist/src/background.ts b/archaeologist/src/background.ts
index 9958472..176570e 100644
--- a/archaeologist/src/background.ts
+++ b/archaeologist/src/background.ts
@@ -27,7 +27,6 @@ import {
NodeUtil,
TotalUserActivity,
ResourceVisit,
- makeDatacenterStorageApi,
UserExternalPipelineId,
NodeCreatedVia,
UserExternalPipelineIngestionProgress,
@@ -35,6 +34,7 @@ import {
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'
@@ -891,7 +891,7 @@ browser.contextMenus.onClicked.addListener(
}
)
-const storage: StorageApi = makeDatacenterStorageApi()
+const storage: StorageApi = makeBrowserExtStorageApi(browser.storage.local)
auth.register()
browserBookmarks.register(storage)
diff --git a/archaeologist/src/content/App.tsx b/archaeologist/src/content/App.tsx
index e8698f6..0c3caca 100644
--- a/archaeologist/src/content/App.tsx
+++ b/archaeologist/src/content/App.tsx
@@ -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,
@@ -392,7 +393,7 @@ const App = () => {
<ContentContext.Provider
value={{
analytics: state.analytics,
- storage: makeDatacenterStorageApi(),
+ storage: makeBrowserExtStorageApi(browser.storage.local),
}}
>
<BrowserHistoryImportControlPortal
diff --git a/archaeologist/src/popup/PopUpApp.tsx b/archaeologist/src/popup/PopUpApp.tsx
index c656c70..81f2ed1 100644
--- a/archaeologist/src/popup/PopUpApp.tsx
+++ b/archaeologist/src/popup/PopUpApp.tsx
@@ -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;
@@ -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>
diff --git a/truthsayer/src/lib/global.tsx b/truthsayer/src/lib/global.tsx
index 75f8924..08792eb 100644
--- a/truthsayer/src/lib/global.tsx
+++ b/truthsayer/src/lib/global.tsx
@@ -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'
@@ -116,7 +116,7 @@ export class MzdGlobal extends React.Component<MzdGlobalProps, MzdGlobalState> {
},
account: null,
analytics: props.analytics,
- storage: makeDatacenterStorageApi(),
+ storage: makeMsgProxyStorageApi(),
}
}
--
2.25.1
|
Media1.mp4 |
Look fantastic! In demo, newly added fragment appeared not on top of existing fragments. Is that on purpose or search results sort has been accidentally broken? |
akindyakov
approved these changes
Jan 15, 2023
It's one of the things that are broken -- unfortunately there are plenty of those. Since this is a big overhaul I'll need to spend more time on testing and bug fixes once the big bits are in place. |
This was referenced Jan 18, 2023
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#351