aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-10-15 17:30:34 +0200
committerAlex Auvolat <alex@adnab.me>2018-10-15 17:30:34 +0200
commit9ab6bdd4536a060f981932f09c5c8f722de25a81 (patch)
tree3c1c2230734d7b412c8725fa1e45f186cb2b6d69
parent07841bd2ec86cb667aea633de5dcb068751e64d3 (diff)
downloadshard-9ab6bdd4536a060f981932f09c5c8f722de25a81.tar.gz
shard-9ab6bdd4536a060f981932f09c5c8f722de25a81.zip
don't do useless stuff
-rw-r--r--shard/lib/app/identity.ex12
1 files changed, 9 insertions, 3 deletions
diff --git a/shard/lib/app/identity.ex b/shard/lib/app/identity.ex
index b034107..65e7031 100644
--- a/shard/lib/app/identity.ex
+++ b/shard/lib/app/identity.ex
@@ -79,9 +79,15 @@ defmodule SApp.Identity do
end
def handle_cast(:send_deps, state) do
- default_deps = [
- %SApp.Directory.Manifest{owner: state.pk, public: false, name: "friends"}
- ]
+ default_deps =
+ if Shard.Keys.have_sk?(state.pk) do
+ [
+ %SApp.Directory.Manifest{owner: state.pk, public: false, name: "friends"}
+ ]
+ else
+ []
+ end
+
GenServer.cast(Shard.Manager, {:dep_list, state.id, default_deps})
{:noreply, state}
end