Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow ts to infer types #241

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/HorizontalDraftPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const props = defineProps<{

const settings = useStoreSettings();
const draftStore = useDraftStore();
const featuredPhoto = ref<any>();
const featuredPhoto = ref<string | HTMLImageElement | ArrayBuffer>();
const inWidget = ref(true);
const delayActiveDraft = ref(false);
const showDelete = ref(false);
Expand Down
2 changes: 1 addition & 1 deletion src/components/popups/BasicConfirmAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ withDefaults(
);

defineEmits(['close', 'confirm']);
const showInfoBubble = ref<boolean>(false);
const showInfoBubble = ref(false);
</script>

<template>
Expand Down
6 changes: 3 additions & 3 deletions src/components/popups/ChangeTierPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ const props = withDefaults(

const store = useStore();
const usePayment = usePaymentsStore();
const step = ref<number>(0);
const step = ref(0);
const selectedTier = ref<SubscriptionTier>(props.toPreSelectTier);
const selectedPeriod = ref<string>(`month`);
const selectedPeriod = ref(`month`);
const paymentProfile = computed(() => usePayment.paymentProfile(props.author.id));
const canSwitchTier = ref<boolean>(true);
const canSwitchTier = ref(true);

defineEmits([`close`]);

Expand Down
2 changes: 1 addition & 1 deletion src/components/popups/CommentsPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const props = withDefaults(
{},
);

const filter = ref<string>(``);
const filter = ref(``);
const canComment = ref(true);
const commentsStore = useCommentsStore();
const store = useStore();
Expand Down
8 changes: 4 additions & 4 deletions src/components/popups/EditProfile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ defineExpose({ updateFromProfile });
id="bio"
:maxlength="maxCharBio"
:value="bio"
:placeholder="`Display Blogchain Bio`"
:placeholder="`Enter your Blogchain bio`"
class="bg-gray1 dark:bg-gray7 dark:text-darkPrimaryText placeholder-gray5 dark:placeholder-gray3 focus:outline-none w-full rounded-lg px-2 py-1 text-black"
@input="bio = ($event.target as HTMLInputElement).value"
@keyup="checkBio()"
Expand All @@ -229,7 +229,7 @@ defineExpose({ updateFromProfile });
id="location"
v-model="location"
type="text"
:placeholder="`Display your location`"
:placeholder="`Enter your location`"
class="bg-gray1 dark:bg-gray7 dark:text-darkPrimaryText placeholder-gray5 dark:placeholder-gray3 focus:outline-none flex-grow rounded-lg px-2 py-1 text-black"
/>
</div>
Expand All @@ -240,7 +240,7 @@ defineExpose({ updateFromProfile });
id="website"
v-model="website"
type="text"
:placeholder="`Display a website`"
:placeholder="`Enter your website`"
class="bg-gray1 dark:bg-gray7 dark:text-darkPrimaryText placeholder-gray5 dark:placeholder-gray3 focus:outline-none flex-grow rounded-lg px-2 py-1 text-black"
/>
</div>
Expand All @@ -251,7 +251,7 @@ defineExpose({ updateFromProfile });
id="newEmail"
v-model="newEmail"
type="email"
:placeholder="`Display a contact email`"
:placeholder="`Enter your email address`"
class="bg-gray1 dark:bg-gray7 dark:text-darkPrimaryText placeholder-gray5 dark:placeholder-gray3 focus:outline-none flex-grow rounded-lg px-2 py-1 text-black"
/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/popups/EncryptKeyPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import EyeIcon from '@/components/icons/PreviewIcon.vue';

const emit = defineEmits([`close`, `encrypt`]);

const seePassword = ref<boolean>(false);
const encryptedPassword = ref<string>(``);
const seePassword = ref(false);
const encryptedPassword = ref(``);
const passwordInput = ref<HTMLInputElement>();

function handleEncryption() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/popups/FollowingPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function toggleDiscover() {
</div>
<article v-if="followingList.size == 0" class="mt-24 grid justify-items-center px-10 xl:px-0">
<p class="text-gray5 dark:text-gray3 mb-5 text-center text-sm">
<span v-if="$route.name === `home` || authorID === store.$state.id">
<span v-if="$route.name === `Home` || authorID === store.$state.id">
It seems you aren't following anyone yet!
</span>
<span v-else-if="profile.name !== ``"> It looks like {{ profile.name }} isn't following anyone yet! </span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/popups/OnboardingWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const store = useStore();
const route = useRoute();
const rootStore = useRootStore();
const profileStore = useProfilesStore();
const step = ref<number>(0);
const step = ref(0);
const myProfile = computed(() => profileStore.getProfile(store.$state.id));
const myAvatar = ref<string | ArrayBuffer | null>(null);
const settings = ref<any>();
Expand Down
4 changes: 2 additions & 2 deletions src/components/popups/QuotePopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const props = withDefaults(
subtitle: undefined,
},
);
const quoteContent = ref<string>(``);
const replyInputHeight = ref<number>(64);
const quoteContent = ref(``);
const replyInputHeight = ref(64);

async function handleSendRepost() {
if (quoteContent.value === ``) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/popups/QuotesPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const props = withDefaults(
{},
);

const isLoading = ref<boolean>(true);
const isLoading = ref(true);
const reposts = ref<IRepostResponse[]>([]);

onMounted(async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/popups/RepostersPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const props = withDefaults(
{},
);

const isLoading = ref<boolean>(true);
const isLoading = ref(true);
const reposters = ref<Array<string>>([]);
const repostersProfiles = ref<Array<Profile>>([]);

Expand Down
10 changes: 5 additions & 5 deletions src/components/popups/SharePopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ const props = withDefaults(
{},
);

const image = ref<string>(``);
const image = ref(``);

const isOpen1 = ref<boolean>(false);
const isLoading = ref<boolean>(true);
const isOpen1 = ref(false);
const isLoading = ref(true);

const generatedDirectLink = ref<string>(``);
const generatedBlogchainLink = ref<string>(``);
const generatedDirectLink = ref(``);
const generatedBlogchainLink = ref(``);

function toggleAccordion1() {
isOpen1.value = !isOpen1.value;
Expand Down
4 changes: 2 additions & 2 deletions src/components/popups/SubInfosPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ const store = useStore();
const useSubscription = useSubscriptionStore();
const usePayment = usePaymentsStore();
const transactions = ref<SubsTransaction[]>([]);
const showAlert = ref<boolean>(false);
const showAlert = ref(false);
const paymentProfile = ref<PaymentProfile>();
const currency = ref<string>(getCurrencySymbol(props.sub.currency));
const currency = ref(getCurrencySymbol(props.sub.currency));

const emit = defineEmits(['close', 'switchPopup']);

Expand Down
4 changes: 2 additions & 2 deletions src/components/popups/SubscriptionsPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ const selectedPeriod = computed(() => useSubscription.$state.selectedPeriod);
const cardErrorMessage = computed(() => useSubscription.$state.cardErrorMessage);
const saveEmail = computed(() => useSubscription.$state.saveEmail);
const paymentProfile = computed(() => usePayments.paymentProfile(props.author.id));
const customerEmail = ref<string>(``);
const customerEmail = ref(``);
const displayButtons = ref({
applePay: false,
googlePay: false,
});
const isLoading = ref<boolean>(false);
const isLoading = ref(false);
const userIsFollowed = computed(() => connectionsStore.getFollowStatus(store.id, props.author.id));
let paymentRequest: PaymentRequest | null = null;
let elements: StripeElements | null = null;
Expand Down
2 changes: 1 addition & 1 deletion src/components/popups/WarningPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import CloseIcon from '@/components/icons/CloseIcon.vue';
const settings = useStoreSettings();
const emit = defineEmits([`close`]);

const showInfoBubble = ref<boolean>(false);
const showInfoBubble = ref(false);
</script>
<template>
<div
Expand Down
2 changes: 1 addition & 1 deletion src/components/post/BookmarkButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const postsStore = usePostsStore();
const store = useStore();
const rootStore = useRootStore();

const isBookmarked = ref<boolean>(props.hasBookmark);
const isBookmarked = ref(props.hasBookmark);

const handleBookmark = async () => {
if (store.$state.id === ``) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/post/PostCardContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const props = withDefaults(
const postsStore = usePostsStore();
const store = useStore();

const isDeleted = ref<boolean>(false);
const isDeleted = ref(false);
async function deletePost() {
try {
await postsStore.removePost(props.fetchedPost.post._id, store.$state.id);
Expand Down
2 changes: 1 addition & 1 deletion src/components/post/QuoteListCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const postsStore = usePostsStore();
const settings = useStoreSettings();
const profile = computed(() => profileStore.getProfile(props.authorid));
const content = ref<string | undefined>();
const showDelete = ref<boolean>(false);
const showDelete = ref(false);

function openDeleteDropdown() {
showDelete.value = true;
Expand Down
2 changes: 1 addition & 1 deletion src/components/post/RepostButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const rootStore = useRootStore();
const isReposted = ref<boolean>(props.repost !== undefined);
const repostsCount = ref<number>(props.repostCount);
const repostCID = ref<string | undefined>(props.repost);
const repostDropdown = ref<boolean>(false);
const repostDropdown = ref(false);

async function toggleRepost() {
// undo repost
Expand Down
6 changes: 3 additions & 3 deletions src/components/post/SimpleFeedCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ const commentsStore = useCommentsStore();
const store = useStore();
const settings = useStoreSettings();
const profilesStore = useProfilesStore();
const showDelete = ref<boolean>(false);
const showProfileCard = ref<boolean>(false);
const hasEntered = ref<boolean>(false);
const showDelete = ref(false);
const showProfileCard = ref(false);
const hasEntered = ref(false);

const props = withDefaults(
defineProps<{
Expand Down
2 changes: 1 addition & 1 deletion src/components/post/SimplePopupCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const emit = defineEmits([`close`, `delete`]);
const store = useStore();
const settings = useStoreSettings();
const profilesStore = useProfilesStore();
const showDelete = ref<boolean>(false);
const showDelete = ref(false);

// Get profile of authorID
const author = computed(() => profilesStore.getProfile(props.fetchedPost.post.authorID));
Expand Down
6 changes: 3 additions & 3 deletions src/components/post/Stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ interface FaceStat {
const settings = useStoreSettings();
const commentsStore = useCommentsStore();
const facePercentage = ref<FaceStat[]>([]);
const page = ref<number>(0);
const showReposters = ref<boolean>(false);
const showQuotes = ref<boolean>(false);
const page = ref(0);
const showReposters = ref(false);
const showQuotes = ref(false);
const commentsStats = computed(() => commentsStore.getCommentStats(props.id));

async function updateCommentsStats() {
Expand Down
14 changes: 7 additions & 7 deletions src/components/post/comments/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ const props = defineProps<{
parentauthorid?: string;
}>();
// comment
const showLabel = ref<boolean>(false);
const showLabel = ref(false);

const showReplies = ref<boolean>(false);
const showDelete = ref<boolean>(false);
const commentDeleted = ref<boolean>(false);
const content = ref<string>('');
const showReplies = ref(false);
const showDelete = ref(false);
const commentDeleted = ref(false);
const content = ref('');
const replies = computed(() => commentsStore.getCommentsOfPost(props.cid));
const author = computed(() => {
if (typeof props.authorid !== `string`) {
Expand All @@ -47,8 +47,8 @@ const author = computed(() => {
});

// replies
const reply = ref<string>(``);
const replyInputHeight = ref<number>(64);
const reply = ref(``);
const replyInputHeight = ref(64);

function handleResize(e: any) {
if (e.srcElement.clientHeight !== e.srcElement.scrollHeight) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/post/comments/CommentEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const props = withDefaults(
{},
);

const showEmotions = ref<boolean>(false);
const showEmotions = ref(false);
const selectedEmotionColor = ref<EmotionCategories | `neutralLightest`>(`neutralLightest`);
const selectedEmotion = ref<IFace | null>(null);
const activeEmotion = ref<IFace | null>(null);
const comment = ref<string>(``);
const comment = ref(``);
const commentsStats = computed(() => commentsStore.getCommentStats(props.parentcid));

function sleep(ms: any) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/post/comments/CommentFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const props = withDefaults(
);

const settings = useStoreSettings();
const showFilter = ref<boolean>(false);
const showFilter = ref(false);
const feeling = ref<EmotionCategories>(`positive`);

function setCommentFilterFeeling(input: EmotionCategories) {
Expand Down