From c2dc7906e47a05cecc6350fd6a3d6f6f955a3423 Mon Sep 17 00:00:00 2001
From: HampusM <hampus@hampusmat.com>
Date: Tue, 6 Jul 2021 14:55:58 +0200
Subject: Frontend uses shared types

---
 packages/client/src/views/RepositoryAbout.vue | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'packages/client/src/views/RepositoryAbout.vue')

diff --git a/packages/client/src/views/RepositoryAbout.vue b/packages/client/src/views/RepositoryAbout.vue
index ff96f53..dc759d1 100644
--- a/packages/client/src/views/RepositoryAbout.vue
+++ b/packages/client/src/views/RepositoryAbout.vue
@@ -16,11 +16,12 @@
 <script lang="ts">
 import { defineComponent, Ref, ref } from "vue";
 import fetchData from "../util/fetch";
+import { Tree } from "shared_types";
+import { getParam } from "../util/util";
 
 import RepositoryTreeBlob from "../components/RepositoryTreeBlob.vue";
 import Loading from "vue-loading-overlay";
 import BaseErrorMessage from "../components/BaseErrorMessage.vue";
-import { getParam } from "../util/util";
 
 export default defineComponent({
 	name: "RepositoryAbout",
@@ -35,9 +36,9 @@ export default defineComponent({
 		const fetch_failed: Ref<string> = ref("");
 
 		const fetchReadme = async(repository: string) => {
-			const readme_data = await fetchData(`repos/${repository}/tree?path=README.md`, fetch_failed, is_loading, "tree");
+			const readme_data: Tree = await fetchData(`repos/${repository}/tree?path=README.md`, fetch_failed, is_loading, "tree");
 
-			if(readme_data) {
+			if(readme_data && typeof readme_data.content === "string") {
 				readme.value = readme_data.content;
 			}
 		};
-- 
cgit v1.2.3-18-g5258

