Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Frontend
Commits
0c97769d
Commit
0c97769d
authored
3 years ago
by
Erwan Rouchet
Committed by
Bastien Abadie
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Prevent OrientationPanel from patching on mount or element change
parent
9072a72a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1027
Prevent OrientationPanel from patching on mount or element change
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vue/Element/OrientationPanel.vue
+10
-1
10 additions, 1 deletion
vue/Element/OrientationPanel.vue
with
10 additions
and
1 deletion
vue/Element/OrientationPanel.vue
+
10
−
1
View file @
0c97769d
...
...
@@ -66,7 +66,16 @@ export default {
if
(
!
this
.
loading
)
this
.
mirrored
=
!
this
.
mirrored
},
async
updateElement
()
{
if
(
this
.
loading
)
return
/*
* When the component is loaded, when the element changes while browsing between neighbors
* or when the element is loaded after the component, a watcher updates this component's fields
* to keep them up-to-date with the element.
* This update can cause updateElement to trigger, and that could cause unnecessary PATCH requests
* to update the element's attributes to the ones it already has.
* If the user does not have write access, this could also cause 403 errors.
* We prevent this by not allowing any PATCH requests if the element's attributes are the same as our fields.
*/
if
(
this
.
loading
||
(
this
.
rotationAngle
===
this
.
element
.
rotation_angle
&&
this
.
mirrored
===
this
.
element
.
mirrored
))
return
this
.
loading
=
true
try
{
await
this
.
patch
({
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment