Skip to content

Commit c08ae1f

Browse files
Kiliseikilisei
authored andcommitted
use shallowRef and remove not needed refs
1 parent 13b7351 commit c08ae1f

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

web_src/js/components/ContextPopup.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
import {SvgIcon} from '../svg.ts';
33
import {GET} from '../modules/fetch.ts';
44
import {getIssueColor, getIssueIcon} from '../features/issue.ts';
5-
import {computed, onMounted, ref, shallowRef, useTemplateRef} from 'vue';
5+
import {computed, onMounted, shallowRef, useTemplateRef} from 'vue';
66
import type {IssuePathInfo} from '../types.ts';
77
88
const {appSubUrl, i18n} = window.config;
99
1010
const loading = shallowRef(false);
11-
const issue = ref(null);
11+
const issue = shallowRef(null);
1212
const renderedLabels = shallowRef('');
1313
const i18nErrorOccurred = i18n.error_occurred;
1414
const i18nErrorMessage = shallowRef(null);

web_src/js/components/PullRequestMergeForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {toggleElem} from '../utils/dom.ts';
55
66
const {csrfToken, pageData} = window.config;
77
8-
const mergeForm = ref(pageData.pullRequestMergeForm);
8+
const mergeForm = shallowRef(pageData.pullRequestMergeForm);
99
1010
const mergeTitleFieldValue = shallowRef('');
1111
const mergeMessageFieldValue = shallowRef('');

web_src/js/components/RepoActivityTopAuthors.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script lang="ts" setup>
22
// @ts-expect-error - module exports no types
33
import {VueBarGraph} from 'vue-bar-graph';
4-
import {computed, onMounted, ref, useTemplateRef} from 'vue';
4+
import {computed, onMounted, shallowRef, useTemplateRef} from 'vue';
55
6-
const colors = ref({
6+
const colors = shallowRef({
77
barColor: 'green',
88
textColor: 'black',
99
textAltColor: 'white',

web_src/js/components/RepoCodeFrequency.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
import {chartJsColors} from '../utils/color.ts';
2424
import {sleep} from '../utils.ts';
2525
import 'chartjs-adapter-dayjs-4/dist/chartjs-adapter-dayjs-4.esm';
26-
import {onMounted, ref, shallowRef} from 'vue';
26+
import {onMounted, shallowRef} from 'vue';
2727
2828
const {pageData} = window.config;
2929
@@ -49,8 +49,8 @@ defineProps<{
4949
5050
const isLoading = shallowRef(false);
5151
const errorText = shallowRef('');
52-
const repoLink = ref(pageData.repoLink || []);
53-
const data = ref<DayData[]>([]);
52+
const repoLink = pageData.repoLink || [];
53+
const data = shallowRef<DayData[]>([]);
5454
5555
onMounted(() => {
5656
fetchGraphData();
@@ -61,7 +61,7 @@ async function fetchGraphData() {
6161
try {
6262
let response: Response;
6363
do {
64-
response = await GET(`${repoLink.value}/activity/code-frequency/data`);
64+
response = await GET(`${repoLink}/activity/code-frequency/data`);
6565
if (response.status === 202) {
6666
await sleep(1000); // wait for 1 second before retrying
6767
}

web_src/js/components/RepoRecentCommits.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ defineProps<{
4545
4646
const isLoading = shallowRef(false);
4747
const errorText = shallowRef('');
48-
const repoLink = ref(pageData.repoLink || []);
48+
const repoLink = pageData.repoLink || [];
4949
const data = ref<DayData[]>([]);
5050
5151
onMounted(() => {
@@ -57,7 +57,7 @@ async function fetchGraphData() {
5757
try {
5858
let response: Response;
5959
do {
60-
response = await GET(`${repoLink.value}/activity/recent-commits/data`);
60+
response = await GET(`${repoLink}/activity/recent-commits/data`);
6161
if (response.status === 202) {
6262
await sleep(1000); // wait for 1 second before retrying
6363
}

web_src/js/components/ViewFileTreeItem.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts" setup>
22
import {SvgIcon} from '../svg.ts';
33
import {isPlainClick} from '../utils/dom.ts';
4-
import {ref, shallowRef} from 'vue';
4+
import {shallowRef} from 'vue';
55
import {type createViewFileTreeStore} from './ViewFileTreeStore.ts';
66
77
type Item = {
@@ -21,7 +21,7 @@ const props = defineProps<{
2121
2222
const store = props.store;
2323
const isLoading = shallowRef(false);
24-
const children = ref(props.item.children);
24+
const children = shallowRef(props.item.children);
2525
const collapsed = shallowRef(!props.item.children);
2626
2727
const doLoadChildren = async () => {

0 commit comments

Comments
 (0)