fix(@desktop/chat): fix upload of image with special characters
fixes #3034
This commit is contained in:
parent
0bc7a6038b
commit
5488abcbde
|
@ -1,7 +1,8 @@
|
||||||
import strutils
|
import strutils
|
||||||
|
import uri as uri
|
||||||
|
|
||||||
proc formatImagePath*(imagePath: string): string =
|
proc formatImagePath*(imagePath: string): string =
|
||||||
result = replace(imagePath, "file://", "")
|
result = uri.decodeUrl(replace(imagePath, "file://", ""))
|
||||||
if defined(windows):
|
if defined(windows):
|
||||||
# Windows doesn't work with paths starting with a slash
|
# Windows doesn't work with paths starting with a slash
|
||||||
result.removePrefix('/')
|
result.removePrefix('/')
|
||||||
|
|
Loading…
Reference in New Issue