Finally working on mobile

This commit is contained in:
Binary 2025-02-04 17:00:41 -04:00
parent 0abce483e8
commit f5fd29391c
2 changed files with 9 additions and 4 deletions

View file

@ -1,7 +1,7 @@
{
"id": "bin-theme-controller",
"name": "Theme Controller",
"version": "1.0.4",
"version": "1.0.5",
"minAppVersion": "0.15.0",
"description": "Set when and how the themes will be displayed.",
"author": "Binaris",

View file

@ -1,4 +1,4 @@
import { App, TFile } from "obsidian";
import { App, TFile, Plugin } from 'obsidian';
import ThControl from "./main";
import { IThControlSettings } from "./settings/settings";
import * as path from 'path-browserify';
@ -44,9 +44,14 @@ export class PathController {
export function isPathInside(basePath: string, targetPath: string): number {
const normalizedBase = path.resolve(basePath);
const normalizedTarget = path.resolve(targetPath);
let normalizedBase = basePath
let normalizedTarget = targetPath
if(!app.isMobile){
normalizedBase = path.resolve(basePath);
normalizedTarget = path.resolve(targetPath);
}
if (normalizedTarget.startsWith(normalizedBase + path.sep)) {
const baseParts = normalizedBase.split(path.sep);
const targetParts = normalizedTarget.split(path.sep);