From 9ab6bdd4536a060f981932f09c5c8f722de25a81 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 15 Oct 2018 17:30:34 +0200 Subject: don't do useless stuff --- shard/lib/app/identity.ex | 12 +++++++++--- 1 file 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 -- cgit v1.2.3