Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
Don't do two requests when expanding folders
Merged rudolfs opened 2 years ago
1 file changed +7 -9 339bd718 b4dca512
modified src/views/projects/Source/Tree/Folder.svelte
@@ -28,14 +28,6 @@
  const dispatch = createEventDispatcher<{ select: string }>();
  const onSelectFile = ({ detail: path }: { detail: string }) =>
    dispatch("select", path);
-

-
  const onClick = () => {
-
    expanded = !expanded;
-

-
    tree = fetchTree(prefix).then(tree => {
-
      if (expanded) return tree;
-
    });
-
  };
</script>

<style>
@@ -78,7 +70,13 @@
</style>

<!-- svelte-ignore a11y-click-events-have-key-events -->
-
<div role="button" tabindex="0" class="folder" on:click={onClick}>
+
<div
+
  role="button"
+
  tabindex="0"
+
  class="folder"
+
  on:click={() => {
+
    expanded = !expanded;
+
  }}>
  <div class="icon-container">
    {#if expanded}
      <IconSmall name="folder-open" />