Skip to content

Commit ea3823f

Browse files
Merge pull request #823 from Adamant-im/fix/pages
fix: VITE_PUBLIC_PATH for pages
2 parents af21ba8 + 19364cc commit ea3823f

File tree

11 files changed

+64
-52
lines changed

11 files changed

+64
-52
lines changed

.github/workflows/github-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
npm run schema:generate
3939
npm run build
4040
env:
41-
VITE_PUBLIC_PATH: ${{ github.event.repository.name }}
41+
VITE_PUBLIC_PATH: "/${{ github.event.repository.name }}/"
4242
VITE_ROUTER_HISTORY_MODE: hash
4343

4444
- name: Upload artifacts 📁

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "im.adamant.adamantmessengerpwa"
88
minSdkVersion rootProject.ext.minSdkVersion
99
targetSdkVersion rootProject.ext.targetSdkVersion
10-
versionCode 4102
11-
versionName "4.10.2"
10+
versionCode 4103
11+
versionName "4.10.3"
1212
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
aaptOptions {
1414
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "adamant-im",
3-
"version": "4.10.2",
3+
"version": "4.10.3",
44
"type": "module",
55
"author": "ADAMANT Foundation <devs@adamant.im>",
66
"license": "GPLv3",

src/components/Chat/ChatPlaceholder.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
<script lang="ts" setup>
2828
import { useI18n } from 'vue-i18n'
29+
import { joinUrl } from '@/lib/urlFormatter'
2930
3031
const { t } = useI18n()
3132
@@ -36,8 +37,7 @@ type Props = {
3637
}
3738
3839
defineProps<Props>()
39-
40-
const logo = '/img/adamant-logo-transparent-512x512.png'
40+
const logo = joinUrl(import.meta.env.BASE_URL, '/img/adamant-logo-transparent-512x512.png');
4141
const className = 'chat-placeholder'
4242
const classes = {
4343
root: className,

src/components/PartnerInfo.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import IconBox from '@/components/icons/IconBox.vue'
4242
import { mdiClose } from '@mdi/js'
4343
import { computed } from 'vue'
4444
import { useI18n } from 'vue-i18n'
45+
import { joinUrl } from '@/lib/urlFormatter'
4546
4647
const props = defineProps({
4748
address: {
@@ -70,7 +71,7 @@ const emit = defineEmits<{
7071
const { t } = useI18n()
7172
7273
const className = 'partner-info-dialog'
73-
const logo = '/img/adm-qr-invert.png'
74+
const logo = joinUrl(import.meta.env.BASE_URL, '/img/adm-qr-invert.png')
7475
const opts = { scale: 8.8 }
7576
7677
const show = computed({

src/components/QrcodeRendererDialog.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import b64toBlob from 'b64-to-blob'
1919
import FileSaver from 'file-saver'
2020
2121
import QrcodeRenderer from '@/components/QrcodeRenderer.vue'
22+
import { joinUrl } from '@/lib/urlFormatter.js'
2223
2324
export default {
2425
components: {
@@ -54,7 +55,7 @@ export default {
5455
}
5556
},
5657
logoURL() {
57-
return this.logo ? '/img/adm-qr-invert.png' : ''
58+
return this.logo ? joinUrl(import.meta.env.BASE_URL, '/img/adm-qr-invert.png') : ''
5859
}
5960
},
6061
methods: {

src/lib/notifications.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Visibility from 'visibilityjs'
55
import currency from '@/filters/currencyAmountWithSymbol'
66
import { formatMessageBasic } from '@/lib/markdown'
77
import { isAdamantChat } from '@/lib/chat/meta/utils'
8+
import { joinUrl } from '@/lib/urlFormatter.js'
89

910
let _this
1011

@@ -102,7 +103,7 @@ class PushNotification extends Notification {
102103
const notification = new Notify(this.i18n.t('app_title'), {
103104
body: this.messageBody,
104105
closeOnClick: true,
105-
icon: '/img/icons/android-chrome-192x192.png',
106+
icon: joinUrl(import.meta.env.BASE_URL,'/img/icons/android-chrome-192x192.png'),
106107
notifyClick: () => {
107108
if (_this.$route.name !== 'Chat') {
108109
this.router.push({
@@ -149,7 +150,7 @@ class PushNotification extends Notification {
149150
class SoundNotification extends Notification {
150151
constructor(ctx) {
151152
super(ctx)
152-
this.audio = new Audio('/sound/bbpro_link.mp3')
153+
this.audio = new Audio(joinUrl(import.meta.env.BASE_URL, '/sound/bbpro_link.mp3'))
153154
}
154155

155156
notify(messageArrived) {

src/lib/uri.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,4 @@ export function websiteUriToOnion(str) {
178178

179179
return str
180180
}
181+

src/lib/urlFormatter.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function joinUrl(base: string, path: string) {
2+
return base.replace(/\/$/, '') + '/' + path.replace(/^\/+/, '');
3+
}

0 commit comments

Comments
 (0)