File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
src/main/kotlin/com/coder/gateway Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class TemplateIconDownloader {
15
15
private val coderClient: CoderRestClientService = service()
16
16
private val cache = mutableMapOf<Pair <String , String >, Icon > ()
17
17
18
- fun load (path : String , templateName : String ): Icon {
18
+ fun load (path : String , workspaceName : String ): Icon {
19
19
var url: URL ? = null
20
20
if (path.startsWith(" http" )) {
21
21
url = path.toURL()
@@ -24,19 +24,19 @@ class TemplateIconDownloader {
24
24
}
25
25
26
26
if (url != null ) {
27
- val cachedIcon = cache[Pair (templateName , path)]
27
+ val cachedIcon = cache[Pair (workspaceName , path)]
28
28
if (cachedIcon != null ) {
29
29
return cachedIcon
30
30
}
31
31
var img = ImageLoader .loadFromUrl(url)
32
32
if (img != null ) {
33
33
val icon = IconUtil .toRetinaAwareIcon(Scalr .resize(ImageUtil .toBufferedImage(img), Scalr .Method .ULTRA_QUALITY , 32 ))
34
- cache[Pair (templateName , path)] = icon
34
+ cache[Pair (workspaceName , path)] = icon
35
35
return icon
36
36
}
37
37
}
38
38
39
- return iconForChar(templateName .lowercase().first())
39
+ return iconForChar(workspaceName .lowercase().first())
40
40
}
41
41
42
42
private fun iconForChar (c : Char ) = when (c) {
Original file line number Diff line number Diff line change @@ -523,7 +523,7 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
523
523
null
524
524
)
525
525
cs.launch(Dispatchers .IO ) {
526
- wm.templateIcon = iconDownloader.load(wm.templateIconPath, wm.templateName )
526
+ wm.templateIcon = iconDownloader.load(wm.templateIconPath, wm.name )
527
527
withContext(Dispatchers .Main ) {
528
528
tableOfWorkspaces.updateUI()
529
529
}
@@ -550,7 +550,7 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
550
550
agent.directory
551
551
)
552
552
cs.launch(Dispatchers .IO ) {
553
- wm.templateIcon = iconDownloader.load(wm.templateIconPath, wm.templateName )
553
+ wm.templateIcon = iconDownloader.load(wm.templateIconPath, wm.name )
554
554
withContext(Dispatchers .Main ) {
555
555
tableOfWorkspaces.updateUI()
556
556
}
@@ -575,7 +575,7 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
575
575
null
576
576
)
577
577
cs.launch(Dispatchers .IO ) {
578
- wm.templateIcon = iconDownloader.load(wm.templateIconPath, wm.templateName )
578
+ wm.templateIcon = iconDownloader.load(wm.templateIconPath, wm.name )
579
579
withContext(Dispatchers .Main ) {
580
580
tableOfWorkspaces.updateUI()
581
581
}
You can’t perform that action at this time.
0 commit comments