Commit 0b508144 authored by Nicolas Pernoud's avatar Nicolas Pernoud
Browse files

fix: code smells

parent b29b803c
Pipeline #6146 passed with stages
in 2 minutes and 49 seconds
......@@ -17,7 +17,7 @@ func (u user) String() string {
return fmt.Sprintf("Login: %v, Password: %v", u.Login, u.Password)
}
func Test_manager_CreateToken_unStoreData(t *testing.T) {
func TestManagerCreateTokenUnStoreData(t *testing.T) {
key, _ := common.GenerateRandomBytes(32)
key2, _ := common.GenerateRandomBytes(32)
type fields struct {
......
......@@ -82,9 +82,9 @@ export class Explorer {
await this.navigate("/");
}
async navigate(path) {
if (!path.endsWith("/")) path += "/";
this.path = path;
async navigate(destPath) {
if (!destPath.endsWith("/")) destPath += "/";
this.path = destPath;
this.progress.classList.remove("is-hidden");
try {
const response = await fetch(this.fullHostname + this.path, {
......@@ -577,11 +577,11 @@ function parseWebDavResponse(txt) {
return files.sort(fileSortFunction);
}
function goUp(path) {
if (path === "/") return path;
if (path.endsWith("/")) path = path.substring(0, path.length - 1);
const lastSlashPosition = path.lastIndexOf("/");
return lastSlashPosition === 0 ? "/" : path.substring(0, lastSlashPosition + 1);
function goUp(destPath) {
if (destPath === "/") return destPath;
if (destPath.endsWith("/")) destPath = destPath.substring(0, destPath.length - 1);
const lastSlashPosition = destPath.lastIndexOf("/");
return lastSlashPosition === 0 ? "/" : destPath.substring(0, lastSlashPosition + 1);
}
function sizeToHuman(size) {
......@@ -625,6 +625,6 @@ export async function LoadImage(image, url, user) {
}
}
function path(path, name) {
return path + encodeURIComponent(name);
function path(destPath, name) {
return destPath + encodeURIComponent(name);
}
<!DOCTYPE html>
<html lang="en" class="has-navbar-fixed-top">
<title>Vestibule</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="assets/brand/icons/icon-152x152.png" />
<link rel="manifest" href="assets/brand/manifest.json" />
<link rel="stylesheet" href="assets/bulma.min.css" />
<link rel="stylesheet" href="assets/animate.css" />
<style>
:root {
--animate-duration: 0.25s;
}
</style>
<script defer src="assets/fontawesome/solid.min.js"></script>
<script defer src="assets/fontawesome/fontawesome.min.js"></script>
<script defer type="module" src="main.js"></script>
<head>
<title>Vestibule</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="assets/brand/icons/icon-152x152.png" />
<link rel="manifest" href="assets/brand/manifest.json" />
<link rel="stylesheet" href="assets/bulma.min.css" />
<link rel="stylesheet" href="assets/animate.css" />
<style>
:root {
--animate-duration: 0.25s;
}
</style>
<script defer src="assets/fontawesome/solid.min.js"></script>
<script defer src="assets/fontawesome/fontawesome.min.js"></script>
<script defer type="module" src="main.js"></script>
</head>
<body>
<!-- Navbar -->
<nav id="navbar" class="navbar is-fixed-top" role="navigation" aria-label="main navigation"></nav>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment