Skip to content

Commit

Permalink
fix: [torrust#581] update references to udpated index settings
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Jul 3, 2024
1 parent 661d6f7 commit 59a87c7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
6 changes: 3 additions & 3 deletions components/torrent/TorrentActionCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<div class="flex flex-row gap-3">
<template v-if="showDownloadButtons()">
<button class="btn btn-primary grow" data-cy="torrent-action-download" @click="downloadTorrent(torrent.info_hash, torrent.name)">
download {{ isTrackerClose()? 'private' : '' }} torrent
download {{ isTrackerPrivate()? 'private' : '' }} torrent
</button>
<button class="w-12 p-0 btn btn-primary">
<a data-cy="torrent-action-magnet-link" class="flex items-center" :href="torrent.magnet_link">
Expand Down Expand Up @@ -147,7 +147,7 @@ import {
downloadTorrent,
useRestApi,
isUserLoggedIn,
isTrackerOpen, isTrackerClose, navigateTo
isTrackerPublic, navigateTo
} from "#imports";
import { canEditThisTorrent } from "~/composables/helpers";
Expand All @@ -170,7 +170,7 @@ function hasEditRights (): boolean {
}
function showDownloadButtons (): boolean {
return isUserLoggedIn() || isTrackerOpen();
return isUserLoggedIn() || isTrackerPublic();
}
function seedersPercentage () {
Expand Down
14 changes: 6 additions & 8 deletions composables/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { type TorrentResponse, TrackerMode, type PublicSettings } from "torrust-index-types-lib";
import { type TorrentResponse, type PublicSettings } from "torrust-index-types-lib";
import { useRestApi, useSettings, useUser } from "~/composables/states";

export function isTrackerOpen (): boolean {
const settings = useSettings();

return settings.value.tracker_mode === TrackerMode.Public ||
settings.value.tracker_mode === TrackerMode.Listed;
export function isTrackerPublic (): boolean {
return !isTrackerPrivate();
}

export function isTrackerClose (): boolean {
return !isTrackerOpen();
export function isTrackerPrivate (): boolean {
const settings = useSettings();
return settings.value.tracker_private === true;
}

export function isUserLoggedIn (): boolean {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"lint": "eslint --ext \".ts,.js,.vue\" . --max-warnings=0" ,
"lint": "eslint --ext \".ts,.js,.vue\" . --max-warnings=0",
"lintfix": "eslint --fix --ext \".ts,.js,.vue\" .",
"cypress:open": "cypress open",
"cypress:run": "cypress run"
Expand Down Expand Up @@ -42,7 +42,7 @@
"marked": "^12.0.2",
"notiwind-ts": "^2.0.2",
"torrust-index-api-lib": "^1.0.0-alpha.7",
"torrust-index-types-lib": "^3.0.0-alpha.1",
"torrust-index-types-lib": "^3.0.0-alpha.6",
"uuid": "^9.0.1"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
version = "2"

[core]
private = false

[core.database]
path = "/var/lib/torrust/tracker/database/e2e_testing_sqlite3.db"

Expand Down

0 comments on commit 59a87c7

Please sign in to comment.