Skip to content

Commit

Permalink
Fix bugs detected from sonarcloud.
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrykuku committed Dec 28, 2023
1 parent 31db903 commit 12976c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 7 additions & 2 deletions main/src/components/BrandBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<span v-else class="window ml-4">
<ul :style="{ '--time': 5 * line + 's', '--perc': perc, '--line': line }" class="scroll">
<li v-for="(item, key) in rss" :key="key" class="has-text-left" @click="$messageBus('connect_news')">
<a :href="item.link" class="intro-text" target="_blank" rel="noopener noreferrer">
<a @click="gotoLink(item.link)" class="intro-text is-clickable" target="_blank"
rel="noopener noreferrer">
{{ item.title }}
</a>
</li>
Expand Down Expand Up @@ -64,10 +65,14 @@ export default {
const newFeed = feed.items.map(item => {
return {
title: item.title,
link: DOMPurify.sanitize(item.link, {ALLOWED_URI_REGEXP: /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.1-9]+(?:[^a-z+.1-9]|$))/i})
link: DOMPurify.sanitize(item.link, { ALLOWED_URI_REGEXP: /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.1-9]+(?:[^a-z+.1-9]|$))/i })
}
})
this.rss = newFeed
},
gotoLink(link) {
window.open(link, '_blank')
}
}
}
Expand Down
9 changes: 2 additions & 7 deletions main/vue.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
const webpack = require('webpack')
const path = require("path")
const commitHash = require('child_process')
.execSync('git describe --always')
.toString()
.trim();
const webpack = require('webpack');
const path = require("path");

module.exports = {
publicPath: '/',
Expand Down Expand Up @@ -44,7 +40,6 @@ module.exports = {
'process.env.VUE_APP_DEV_IP': JSON.stringify(process.env.VUE_APP_DEV_IP),
'process.env.VUE_APP_DEV_PORT': JSON.stringify(process.env.VUE_APP_DEV_PORT),
'process.env.VUE_APP_BASE_URL': JSON.stringify(process.env.VUE_APP_BASE_URL),
MAIN_APP_VERSION_ID: JSON.stringify(commitHash),
BUILT_TIME: JSON.stringify(Date()),
}]);
// Production only
Expand Down

0 comments on commit 12976c1

Please sign in to comment.