diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2020-12-22 11:36:43 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2021-01-26 09:02:27 +0100 |
| commit | b3010afda08d83a24f0832a2fadcaf26d90863c1 (patch) | |
| tree | 583f902b597b094efbc4f64dac0cf9e1cb0536e5 /gui/src | |
| parent | 2b055cc39c4eee4b8af8bb193143ddd4055b39ac (diff) | |
| download | mullvadvpn-b3010afda08d83a24f0832a2fadcaf26d90863c1.tar.xz mullvadvpn-b3010afda08d83a24f0832a2fadcaf26d90863c1.zip | |
Replace use of path module
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/renderer/components/Focus.tsx | 3 | ||||
| -rw-r--r-- | gui/src/renderer/components/ImageView.tsx | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/gui/src/renderer/components/Focus.tsx b/gui/src/renderer/components/Focus.tsx index 6a2e9c7126..85c2c307e4 100644 --- a/gui/src/renderer/components/Focus.tsx +++ b/gui/src/renderer/components/Focus.tsx @@ -1,4 +1,3 @@ -import path from 'path'; import React, { useImperativeHandle, useState } from 'react'; import { useLocation } from 'react-router'; import { sprintf } from 'sprintf-js'; @@ -29,7 +28,7 @@ function Focus(props: IFocusProps, ref: React.Ref<IFocusHandle>) { ref, () => ({ resetFocus: () => { - const pageName = path.basename(location.pathname); + const pageName = location.pathname.slice(location.pathname.lastIndexOf('/') + 1); const titleElement = document.getElementsByTagName('h1')[0]; const titleContent = titleElement?.textContent ?? pageName; setTitle(titleContent); diff --git a/gui/src/renderer/components/ImageView.tsx b/gui/src/renderer/components/ImageView.tsx index fd6588b1fb..c828a57c38 100644 --- a/gui/src/renderer/components/ImageView.tsx +++ b/gui/src/renderer/components/ImageView.tsx @@ -1,4 +1,3 @@ -import path from 'path'; import React, { useMemo } from 'react'; import styled from 'styled-components'; @@ -40,7 +39,7 @@ const ImageMask = styled.div((props: IImageMaskProps) => { const HiddenImage = styled.img({ visibility: 'hidden' }); export default function ImageView(props: IImageViewProps) { - const url = path.isAbsolute(props.source) + const url = props.source.startsWith('/') ? props.source : `../../assets/images/${props.source}.svg`; |
