fix: Fixed issue where per-tag preferences were not accessible with offline subscription
This commit is contained in:
@@ -475,7 +475,7 @@ export class WebApplication extends SNApplication implements WebApplicationInter
|
||||
}
|
||||
|
||||
hasValidFirstPartySubscription(): boolean {
|
||||
return this.subscriptionController.hasFirstPartyOnlineOrOfflineSubscription
|
||||
return this.subscriptionController.hasFirstPartyOnlineOrOfflineSubscription()
|
||||
}
|
||||
|
||||
async openPurchaseFlow() {
|
||||
|
||||
@@ -93,7 +93,7 @@ const DisplayOptionsMenu: FunctionComponent<DisplayOptionsMenuProps> = ({
|
||||
: selectedTag.preferences
|
||||
const [currentMode, setCurrentMode] = useState<PreferenceMode>(selectedTagPreferences ? 'tag' : 'global')
|
||||
const [preferences, setPreferences] = useState<TagPreferences>({})
|
||||
const hasSubscription = application.subscriptionController.hasFirstPartyOnlineOrOfflineSubscription
|
||||
const hasSubscription = application.subscriptionController.hasFirstPartyOnlineOrOfflineSubscription()
|
||||
const controlsDisabled = currentMode === 'tag' && !hasSubscription
|
||||
const isDailyEntry = selectedTagPreferences?.entryMode === 'daily'
|
||||
|
||||
@@ -441,7 +441,7 @@ const DisplayOptionsMenu: FunctionComponent<DisplayOptionsMenuProps> = ({
|
||||
<div className="flex flex-col pr-5">
|
||||
<div className="flex flex-row items-center">
|
||||
<div className="text-base font-semibold uppercase text-text lg:text-xs">Daily Notebook</div>
|
||||
<Pill className="px-1.5 py-0" style="success">
|
||||
<Pill className="px-1.5 !py-0.5" style="success">
|
||||
Labs
|
||||
</Pill>
|
||||
</div>
|
||||
@@ -463,7 +463,7 @@ const DisplayOptionsMenu: FunctionComponent<DisplayOptionsMenuProps> = ({
|
||||
<div className="flex flex-col pr-5">
|
||||
<div className="flex flex-row items-center">
|
||||
<div className="text-base font-semibold uppercase text-text lg:text-xs">Table view</div>
|
||||
<Pill className="px-1.5 py-0" style="success">
|
||||
<Pill className="px-1.5 !py-0.5" style="success">
|
||||
Labs
|
||||
</Pill>
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,7 @@ type Props = {
|
||||
const UpgradeNow = ({ application, featuresController, subscriptionContoller }: Props) => {
|
||||
const shouldShowCTA = !featuresController.hasFolders
|
||||
const hasAccount = subscriptionContoller.hasAccount
|
||||
const hasAccessToFeatures = subscriptionContoller.hasFirstPartyOnlineOrOfflineSubscription
|
||||
const hasAccessToFeatures = subscriptionContoller.hasFirstPartyOnlineOrOfflineSubscription()
|
||||
|
||||
const onClick = useCallback(() => {
|
||||
if (hasAccount && application.isNativeIOS()) {
|
||||
|
||||
@@ -87,7 +87,7 @@ export class LinkingController extends AbstractViewController implements Interna
|
||||
}
|
||||
|
||||
get isEntitledToNoteLinking() {
|
||||
return !!this.subscriptionController.hasFirstPartyOnlineOrOfflineSubscription
|
||||
return this.subscriptionController.hasFirstPartyOnlineOrOfflineSubscription()
|
||||
}
|
||||
|
||||
setIsLinkingPanelOpen = (open: boolean) => {
|
||||
|
||||
@@ -36,7 +36,6 @@ export class SubscriptionController extends AbstractViewController implements In
|
||||
hasAccount: observable,
|
||||
onlineSubscription: observable,
|
||||
|
||||
hasFirstPartyOnlineOrOfflineSubscription: computed,
|
||||
usedInvitationsCount: computed,
|
||||
allowedInvitationsCount: computed,
|
||||
allInvitationsUsed: computed,
|
||||
@@ -89,7 +88,7 @@ export class SubscriptionController extends AbstractViewController implements In
|
||||
}
|
||||
}
|
||||
|
||||
get hasFirstPartyOnlineOrOfflineSubscription(): boolean {
|
||||
hasFirstPartyOnlineOrOfflineSubscription(): boolean {
|
||||
if (this.sessions.isSignedIn()) {
|
||||
if (!this.sessions.isSignedIntoFirstPartyServer()) {
|
||||
return false
|
||||
@@ -97,7 +96,8 @@ export class SubscriptionController extends AbstractViewController implements In
|
||||
|
||||
return this.subscriptions.getOnlineSubscription() !== undefined
|
||||
} else {
|
||||
return this.features.hasFirstPartyOfflineSubscription()
|
||||
const offline = this.features.hasFirstPartyOfflineSubscription()
|
||||
return offline
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user