Skip to content

Commit

Permalink
Merge branch 'hotfix/3.19.29'
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed May 20, 2024
2 parents 9b3e9a8 + a4d584f commit 84d8b69
Show file tree
Hide file tree
Showing 22 changed files with 304 additions and 362 deletions.
2 changes: 1 addition & 1 deletion external/@worldbrain/memex-common
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "worldbrain-extension",
"version": "3.19.28",
"version": "3.19.29",
"homepage": "https://memex.garden",
"repository": "https://github.com/WorldBrain/Memex",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/authentication/upgrade-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class UpgradeModal extends UIElement<
{this.props.limitReachedNotif === 'AI' && (
<UpgradeOverlayTextContainer>
<UpgradeOverlayText>
You reached the monthly limit of $
You reached the daily limit of{' '}
{DEFAULT_POWERUP_LIMITS.AIpowerup} AI sessions
</UpgradeOverlayText>
<UpgradeOverlaySubText>
Expand Down Expand Up @@ -240,7 +240,7 @@ export default class UpgradeModal extends UIElement<
{this.props.limitReachedNotif === 'Bookmarks' && (
<UpgradeOverlayTextContainer>
<UpgradeOverlayText>
You reached the monthly limit of $
You reached the daily limit of{' '}
{DEFAULT_POWERUP_LIMITS.bookmarksPowerUp} saved
pages
</UpgradeOverlayText>
Expand Down
4 changes: 1 addition & 3 deletions src/background-script/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,7 @@ class BackgroundScript {
}

private async trackInstallTime() {
await trackOnboardingPath(this.deps.analyticsBG, {
type: 'interactive',
})
return null
}

private async checkForUpdates() {
Expand Down
1 change: 1 addition & 0 deletions src/dashboard-refactor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1759,6 +1759,7 @@ export class DashboardContainer extends StatefulUIElement<
analyticsBG={this.props.analyticsBG}
bgScriptsBG={this.props.bgScriptBG}
browserAPIs={this.props.browserAPIs}
getRootElement={this.props.getRootElement}
/>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard-refactor/search-results/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ export default class SearchResultsContainer extends React.Component<
id="ResultsScrollContainer"
ref={this.ResultsScrollContainerRef}
>
{this.renderOnboardingTutorials()}
{/* {this.renderOnboardingTutorials()} */}
{this.renderTutorialBox()}
{this.renderResultsByDay()}
{this.props.areResultsExhausted &&
Expand Down
64 changes: 38 additions & 26 deletions src/in-page-ui/ribbon/react/containers/ribbon/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,21 +221,21 @@ export class RibbonContainerLogic extends UILogic<
})

try {
const signupDate = new Date(
await (await this.dependencies.authBG.getCurrentUser())
.creationTime,
).getTime()
const isTrial =
(await enforceTrialPeriod30Days(
this.dependencies.browserAPIs,
signupDate,
)) ?? null

if (isTrial) {
this.emitMutation({
isTrial: { $set: isTrial },
signupDate: { $set: signupDate },
})
const currentUser = await this.dependencies.authBG.getCurrentUser()
if (currentUser) {
const signupDate = new Date(currentUser?.creationTime).getTime()
const isTrial =
(await enforceTrialPeriod30Days(
this.dependencies.browserAPIs,
signupDate,
)) ?? null

if (isTrial) {
this.emitMutation({
isTrial: { $set: isTrial },
signupDate: { $set: signupDate },
})
}
}
} catch (error) {
console.error('error in updatePageCounter', error)
Expand Down Expand Up @@ -279,10 +279,12 @@ export class RibbonContainerLogic extends UILogic<
hydrateStateFromDB: EventHandler<'hydrateStateFromDB'> = async ({
event: { url },
}) => {
// Stage 1: All relevant metadata
let lists = []
let interActionTimestamps = []

this.emitMutation({
fullPageUrl: { $set: url },
bookmark: {
isBookmarked: { $set: false },
lastBookmarkTimestamp: { $set: null },
Expand Down Expand Up @@ -313,13 +315,18 @@ export class RibbonContainerLogic extends UILogic<
)

// this section is there because sometimes when switching pages in web apps, the cache is still the old one when trying to see if the page has annotations

annotationsByURL.map((annotation) => {
return interActionTimestamps.push(
Math.floor(annotation.createdWhen / 1000),
)
})

// Set data for lists and annotations
this.emitMutation({
lists: { pageListIds: { $set: lists } },
annotations: { $set: annotationsByURL.length },
})

const bookmark = await this.dependencies.bookmarks.findBookmark(url)

const isBookmarked =
Expand All @@ -329,24 +336,31 @@ export class RibbonContainerLogic extends UILogic<
interActionTimestamps.push(bookmark.time)
}
const saveTime = Math.min.apply(Math, interActionTimestamps)
this.emitMutation({
bookmark: {
isBookmarked: { $set: !!isBookmarked },
lastBookmarkTimestamp: { $set: saveTime },
},
})

// Enable Ribbon after everything set
this.emitMutation({
isRibbonEnabled: {
$set: await this.dependencies.getSidebarEnabled(),
},
})

const activityStatus = await this.dependencies.syncSettings.activityIndicator.get(
'feedHasActivity',
)

// set general settings that are not important for first load
this.emitMutation({
fullPageUrl: { $set: url },
pausing: {
isPaused: {
$set: true,
},
},
bookmark: {
isBookmarked: { $set: !!isBookmarked },
lastBookmarkTimestamp: { $set: saveTime },
},
isRibbonEnabled: {
$set: await this.dependencies.getSidebarEnabled(),
},
tooltip: {
isTooltipEnabled: {
$set: await this.dependencies.tooltip.getState(),
Expand All @@ -357,8 +371,6 @@ export class RibbonContainerLogic extends UILogic<
$set: await this.dependencies.highlights.getState(),
},
},
lists: { pageListIds: { $set: lists } },
annotations: { $set: annotationsByURL.length },
hasFeedActivity: { $set: activityStatus },
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export default class DashboardResultsContainer extends StatefulUIElement<
<Onboarding
browserAPIs={browser}
navToDashboard={this.handleOnboardingComplete}
getRootElement={() => document.getElementById('app')}
/>
)
}
Expand Down
Loading

0 comments on commit 84d8b69

Please sign in to comment.