Skip to content

Commit

Permalink
Sharing UI – Fix up JS comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
te-online committed Dec 2, 2023
1 parent 9125899 commit e7d754e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions js/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -21896,7 +21896,7 @@
};
}

// (104:8) {#if sharee.recipient_type == "group"}
// (104:8) {#if sharee.recipient_type === "group"}
function create_if_block_1$3(ctx) {
var span;
return {
Expand Down Expand Up @@ -21937,7 +21937,7 @@
var button;
var t7;
function select_block_type(ctx, dirty) {
if ( /*sharee*/ctx[16].recipient_type == "group") return create_if_block_1$3;
if ( /*sharee*/ctx[16].recipient_type === "group") return create_if_block_1$3;
return create_else_block$2;
}
var current_block_type = select_block_type(ctx);
Expand Down Expand Up @@ -22245,10 +22245,10 @@
input0.value = /*clientUuid*/ctx[3];
attr(input1, "type", "hidden");
attr(input1, "name", "user_id");
input1.value = input1_value_value = /*selectedSharee*/ctx[6] && /*selectedSharee*/ctx[6].value.shareType == 0 ? /*selectedSharee*/ctx[6].value.shareWith : "";
input1.value = input1_value_value = /*selectedSharee*/ctx[6] && /*selectedSharee*/ctx[6].value.shareType === 0 ? /*selectedSharee*/ctx[6].value.shareWith : "";
attr(input2, "type", "hidden");
attr(input2, "name", "group_id");
input2.value = input2_value_value = /*selectedSharee*/ctx[6] && /*selectedSharee*/ctx[6].value.shareType == 1 ? /*selectedSharee*/ctx[6].value.shareWith : "";
input2.value = input2_value_value = /*selectedSharee*/ctx[6] && /*selectedSharee*/ctx[6].value.shareType === 1 ? /*selectedSharee*/ctx[6].value.shareWith : "";
attr(input3, "type", "hidden");
attr(input3, "name", "requesttoken");
input3.value = /*requestToken*/ctx[4];
Expand Down Expand Up @@ -22301,10 +22301,10 @@
if (!current || dirty & /*clientUuid*/8) {
input0.value = /*clientUuid*/ctx[3];
}
if (!current || dirty & /*selectedSharee*/64 && input1_value_value !== (input1_value_value = /*selectedSharee*/ctx[6] && /*selectedSharee*/ctx[6].value.shareType == 0 ? /*selectedSharee*/ctx[6].value.shareWith : "")) {
if (!current || dirty & /*selectedSharee*/64 && input1_value_value !== (input1_value_value = /*selectedSharee*/ctx[6] && /*selectedSharee*/ctx[6].value.shareType === 0 ? /*selectedSharee*/ctx[6].value.shareWith : "")) {
input1.value = input1_value_value;
}
if (!current || dirty & /*selectedSharee*/64 && input2_value_value !== (input2_value_value = /*selectedSharee*/ctx[6] && /*selectedSharee*/ctx[6].value.shareType == 1 ? /*selectedSharee*/ctx[6].value.shareWith : "")) {
if (!current || dirty & /*selectedSharee*/64 && input2_value_value !== (input2_value_value = /*selectedSharee*/ctx[6] && /*selectedSharee*/ctx[6].value.shareType === 1 ? /*selectedSharee*/ctx[6].value.shareWith : "")) {
input2.value = input2_value_value;
}
if (!current || dirty & /*requestToken*/16) {
Expand Down Expand Up @@ -22394,12 +22394,12 @@
exact = _yield$response$json$.exact;
groups = _yield$response$json$.groups;
existing_users = sharees.filter(function (s) {
return s.recipient_type == "user";
return s.recipient_type === "user";
}).map(function (share) {
return share.recipient_id;
});
existing_groups = sharees.filter(function (s) {
return s.recipient_type == "group";
return s.recipient_type === "group";
}).map(function (share) {
return share.recipient_id;
});
Expand Down Expand Up @@ -22558,7 +22558,7 @@
};
}

// (20:4) {#if sharee.recipient_type == "group"}
// (20:4) {#if sharee.recipient_type === "group"}
function create_if_block_2$2(ctx) {
var span;
return {
Expand Down Expand Up @@ -22587,7 +22587,7 @@
var t1;
var t2;
function select_block_type(ctx, dirty) {
if ( /*sharee*/ctx[2].recipient_type == "group") return create_if_block_2$2;
if ( /*sharee*/ctx[2].recipient_type === "group") return create_if_block_2$2;
return create_else_block$1;
}
var current_block_type = select_block_type(ctx);
Expand Down
10 changes: 5 additions & 5 deletions js/views/ShareDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
if (response.ok) {
const { users, exact, groups } = (await response.json()).ocs.data;
const existing_users = sharees.filter((s) => s.recipient_type == "user").map((share) => share.recipient_id);
const existing_groups = sharees.filter((s) => s.recipient_type == "group").map((share) => share.recipient_id);
const existing_users = sharees.filter((s) => s.recipient_type === "user").map((share) => share.recipient_id);
const existing_groups = sharees.filter((s) => s.recipient_type === "group").map((share) => share.recipient_id);
return [...users, ...exact.users, ...groups, ...exact.groups]
.filter((user) => !existing_users.includes(user.value.shareWith) && user.value.shareWith !== userId)
.filter((group) => !existing_groups.includes(group.value.shareWith));
Expand Down Expand Up @@ -101,7 +101,7 @@
{#each sharees as sharee}
<li>
<figure>
{#if sharee.recipient_type == "group"}
{#if sharee.recipient_type === "group"}
<span aria-hidden="true" role="img" class="material-design-icon account-group-icon"
><svg
fill="currentColor"
Expand Down Expand Up @@ -163,12 +163,12 @@
<input
type="hidden"
name="user_id"
value={selectedSharee && selectedSharee.value.shareType == 0 ? selectedSharee.value.shareWith : ""}
value={selectedSharee && selectedSharee.value.shareType === 0 ? selectedSharee.value.shareWith : ""}
/>
<input
type="hidden"
name="group_id"
value={selectedSharee && selectedSharee.value.shareType == 1 ? selectedSharee.value.shareWith : ""}
value={selectedSharee && selectedSharee.value.shareType === 1 ? selectedSharee.value.shareWith : ""}
/>
<input type="hidden" name="requesttoken" value={requestToken} />
<button type="submit" name="action" value="share" class="btn">{translate("timemanager", "Share client")}</button>
Expand Down
2 changes: 1 addition & 1 deletion js/views/ShareStatus.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ul class="existing-sharees">
{#each sharees as sharee}
<li>
{#if sharee.recipient_type == "group"}
{#if sharee.recipient_type === "group"}
<span aria-hidden="true" role="img" class="material-design-icon account-group-icon"
><svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24" class="material-design-icon__svg"
><path
Expand Down

0 comments on commit e7d754e

Please sign in to comment.