Skip to content

Commit

Permalink
fix empty subscription. close #168
Browse files Browse the repository at this point in the history
  • Loading branch information
vol4tim committed Oct 1, 2024
1 parent fbec864 commit 24120c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hooks/useSubscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const useSubscription = (initialOwner = null) => {
};

const validUntil = computed(() => {
if (dataRaw.value === null) {
if (!dataRaw.value) {
return null;
}
if (dataRaw.value.kind.isLifetime) {
Expand All @@ -136,7 +136,7 @@ export const useSubscription = (initialOwner = null) => {
});

const countMonth = computed(() => {
if (dataRaw.value === null) {
if (!dataRaw.value) {
return 0;
}
let days = 0;
Expand All @@ -148,7 +148,7 @@ export const useSubscription = (initialOwner = null) => {

const isActive = computed(() => {
if (
dataRaw.value === null ||
!dataRaw.value ||
(validUntil.value !== null && Date.now() > validUntil.value)
) {
return false;
Expand All @@ -157,7 +157,7 @@ export const useSubscription = (initialOwner = null) => {
});

const hasSubscription = computed(() => {
return dataRaw.value !== null;
return dataRaw.value;
});

const loadLedger = async () => {
Expand Down

0 comments on commit 24120c0

Please sign in to comment.