Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
plot card render bug fixed (#226)
Browse files Browse the repository at this point in the history
* plot-card fix
* version update 0.5.2
  • Loading branch information
ozgunozerk authored May 26, 2022
1 parent c4ae1b5 commit 6f01a49
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "subspace-desktop",
"version": "0.5.1",
"version": "0.5.2",
"private": true,
"description": "Subspace desktop",
"author": "Subspace Labs <https://subspace.network>",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subspace-desktop"
version = "0.5.1"
version = "0.5.2"
description = "Subspace desktop"
authors = ["Subspace Labs <https://subspace.network>"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/components/plotCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ q-card(bordered flat)
q-icon(color="black" name="storage" size="40px")
.col
.text-weight-light {{ lang.allocated }}
p {{ util.toFixed(plot.plotSizeGB, 2) }} GB
p {{ plot.plotSizeGB }} GB
</template>

<script lang="ts" >
Expand Down
4 changes: 3 additions & 1 deletion src/lib/appConfig.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Dialog, DialogChainObject } from "quasar"
import { appName, errorLogger } from "./util"
import { appName, errorLogger, toFixed } from "./util"
import * as path from "@tauri-apps/api/path"
import * as fs from "@tauri-apps/api/fs"

Expand Down Expand Up @@ -67,6 +67,8 @@ export const appConfig = {
async read(): Promise<Config> {
const result = await fs.readTextFile(await this.configFullPath())
const config: Config = JSON.parse(result)
// TODO: there maybe a better solution, or `sizeGB` should be string in the first place
config.plot.sizeGB = toFixed(Number(config.plot.sizeGB), 2)
return config
},
async write(config: Config): Promise<void> {
Expand Down
1 change: 1 addition & 0 deletions src/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export async function infoLogger(info: unknown): Promise<void> {
}
}

// TODO: rethink about the signature of this function, it should be string instead, and refactor the codebase accordingly
export function toFixed(num: number, precision: number): number {
if (!num) return 0
return parseFloat(num.toFixed(precision))
Expand Down
1 change: 0 additions & 1 deletion src/pages/SetupPlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ export default defineComponent({
util.infoLogger("SETUP PLOT | custom directory created")
await this.checkIdentity()
const nodeName = util.generateNodeName()
global.setNodeName(nodeName);
await appConfig.update({
Expand Down

0 comments on commit 6f01a49

Please sign in to comment.