Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei0x309 committed Sep 23, 2024
1 parent b8e1ac1 commit 441b999
Show file tree
Hide file tree
Showing 16 changed files with 329 additions and 182 deletions.
4 changes: 2 additions & 2 deletions apps/yup-live-mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "gf.info.yup"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 59
versionName "1.4.8"
versionCode 60
versionName "1.4.9"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
4 changes: 2 additions & 2 deletions apps/yup-live-mobile/src/views/ClaimRewardPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
@ion-change="segmentChange"
>
<ion-segment-button value="yup">
<ion-label>All</ion-label>
<ion-label>Yup</ion-label>
</ion-segment-button>
<ion-segment-button value="moxie">
<ion-label>Rewards</ion-label>
<ion-label>Moxie</ion-label>
</ion-segment-button>
</ion-segment>
</div>
Expand Down
29 changes: 18 additions & 11 deletions apps/yup-live-mobile/src/views/CrossPostModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
title="Error"
:type="postErrorType"
class="mb-4"
:timeout="6000"
:timeout="36000"
/>
</div>
<div v-for="(post, index) in posts" :key="index">
Expand Down Expand Up @@ -147,6 +147,7 @@
<div class="flex justify-between">
<button
class="w-1/2 mr-1 bg-stone-600 mb-2 border-0 py-2 px-6 focus:outline-none hover:bg-stone-700 rounded text-[0.8rem]"
:disabled="isFileUploading || isSendPost"
@click="triggerFileInput(index)"
>
<BtnSpinner
Expand All @@ -157,6 +158,7 @@
</button>
<button
class="w-1/2 ml-1 bg-stone-600 mb-2 border-0 py-2 px-6 focus:outline-none hover:bg-stone-700 rounded text-[0.8rem]"
:disabled="isVideoUploading || isSendPost"
@click="triggerVideoFileInput(index)"
>
<BtnSpinner
Expand Down Expand Up @@ -672,7 +674,6 @@ export default defineComponent({
const triggerVideoFileInput = (index: number) => {
if (posts?.[index]?.videoFileInput) {
isVideoUploading.value = true;
posts?.[index]?.videoFileInput?.click();
}
};
Expand Down Expand Up @@ -709,24 +710,27 @@ export default defineComponent({
const onVideoFileUpload = async (f: File | Event, index: number) => {
const videoFile = (posts?.[index]?.videoFileInput?.files?.[0] ?? f) as File;
if (!videoFile) return;
if (postPlatforms.value.includes("bsky")) {
showError(
"Video upload is not supported on BlueSky, your Bluesky post will be sent without the video.",
true
);
postPlatforms.value = postPlatforms.value.filter((p) => p !== "bsky");
if (!videoFile) {
isVideoUploading.value = false;
return;
}
const upload = await mediaUpload(store, postPlatforms.value, videoFile);
isVideoUploading.value = true;
const upload = (await mediaUpload(store, postPlatforms.value, videoFile)) as any;
if (upload?.errors) {
const platforms = [] as TPlatform[];
let errorString = "";
for (const error of upload.errors) {
platforms.push(error.platform);
errorString += `${error.platform}: ${error.message}\n`;
}
postPlatforms.value = postPlatforms.value.filter((p) => !platforms.includes(p));
showError(
`Error uploading video to ${platforms.join(", ")}, platforms removed from post`,
`Error uploading video to ${platforms.join(
", "
)}, platforms removed from post: ${errorString}`,
true
);
if (Object.keys(upload.results).length) {
Expand All @@ -735,6 +739,9 @@ export default defineComponent({
upload.results.id = Math.random().toString(36).substring(7);
posts[index].videos.push(upload.results);
}
} else if (upload.ok === false) {
showError("Error uploading video, due to unknown error", true);
postPlatforms.value = [];
} else {
upload.source = URL.createObjectURL(videoFile);
upload.type = videoFile.type;
Expand Down
2 changes: 1 addition & 1 deletion apps/yup-live-mobile/src/views/TokenMetrics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default defineComponent({
const currentDayEmission = async () => {
const today = new Date();
if (today.getFullYear() > 2024 && today.getMonth() > 8 && today.getDate() > 21) {
if (today.getFullYear() >= 2024 && today.getMonth() >= 8 && today.getDate() >= 22) {
return 10000;
}
const yr = await Promise.all([
Expand Down
2 changes: 1 addition & 1 deletion apps/yup-live/public/mobile/latest-version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.4.8",
"version": "1.4.9",
"forced": false,
"paused": false,
"message": "A new version of the app is available. It is recommended to update to the latest version. Do you want to update now?",
Expand Down
27 changes: 17 additions & 10 deletions apps/yup-live/src/components/content/post/crossPost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
:key="postErrorKey"
:hidden="!postError.length"
:message="postError"
:timeout="6000"
:timeout="36000"
title="Error"
:type="postErrorType"
/>
Expand Down Expand Up @@ -155,6 +155,7 @@
<div class="flex justify-between">
<button
class="w-1/2 mr-1 bg-stone-600 mb-4 border-0 py-2 px-6 focus:outline-none hover:bg-stone-700 rounded text-lg text-[0.8rem]"
:disabled="isFileUploading || isSendPost"
@click="triggerFileInput(index)"
>
<BtnSpinner
Expand All @@ -165,6 +166,7 @@
</button>
<button
class="w-1/2 ml-1 bg-stone-600 mb-4 border-0 py-2 px-6 focus:outline-none hover:bg-stone-700 rounded text-lg text-[0.8rem]"
:disabled="isVideoUploading || isSendPost"
@click="triggerVideoFileInput(index)"
>
<BtnSpinner
Expand Down Expand Up @@ -631,31 +633,33 @@ export default defineComponent({
const triggerVideoFileInput = (index: number) => {
if (posts?.[index]?.videoFileInput) {
isVideoUploading.value = true;
posts?.[index]?.videoFileInput?.click();
}
};
const onVideoFileUpload = async (f: File | Event, index: number) => {
const videoFile = (posts?.[index]?.videoFileInput?.files?.[0] ?? f) as File;
if (!videoFile) return;
if (postPlatforms.value.includes("bsky")) {
showError(
"Video upload is not supported on BlueSky, your Bluesky post will be sent without the video.",
true
);
postPlatforms.value = postPlatforms.value.filter((p) => p !== "bsky");
if (!videoFile) {
isVideoUploading.value = false;
return;
}
isVideoUploading.value = true;
const upload = (await mediaUpload(store, postPlatforms.value, videoFile)) as any;
if (upload?.errors) {
const platforms = [] as TPlatform[];
let errorString = "";
for (const error of upload.errors) {
platforms.push(error.platform);
errorString += `${error.platform}: ${error.message}\n`;
}
postPlatforms.value = postPlatforms.value.filter((p) => !platforms.includes(p));
showError(
`Error uploading video to ${platforms.join(", ")}, platforms removed from post`,
`Error uploading video to ${platforms.join(
", "
)}, platforms removed from post: ${errorString}`,
true
);
if (Object.keys(upload.results).length) {
Expand All @@ -664,6 +668,9 @@ export default defineComponent({
upload.results.id = Math.random().toString(36).substring(7);
posts[index].videos.push(upload.results);
}
} else if (upload.ok === false) {
showError("Error uploading video, due to unknown error", true);
postPlatforms.value = [];
} else {
upload.source = URL.createObjectURL(videoFile);
upload.type = videoFile.type;
Expand Down
Loading

0 comments on commit 441b999

Please sign in to comment.