Git Product home page Git Product logo

Comments (4)

doxas avatar doxas commented on July 26, 2024 1

@0b5vr

言われてみると、エディター(編集者)側の心理を思えば、リロード事故防止機能はあったほうがいいですね。
なぜつけていなかったのか……

既存の、引用いただいた箇所は視聴者数の増減をなるべく正確にやりたかった、というコードな気がします。
beforeunload で無条件に視聴者数をデクリメントするが、もし本当に閉じるかのアラートが出た際に思いとどまった場合、デクリメントしたのに視聴し続けていることになるので閉じられなかった場合の1分後に、自動的にカウントアップする setTimeout を仕込んでる、ということだった気がします。

ご提案いただいたとおり、一度でも編集されている場合はそのタイミングで beforeunload を設定する、というのがよさそうですね。
これはわたしの方で対応できると思いますが、他に懸念点や実装上の要望などはありますでしょうか?

from twigl.

doxas avatar doxas commented on July 26, 2024 1

@0b5vr

とりま対応してみたんで、twigl.app で動作見てみてください。
不具合ありましたら教えてください!

from twigl.

0b5vr avatar 0b5vr commented on July 26, 2024 1

良さそうです!修正ありがとうございます。

51a6cd5

from twigl.

0b5vr avatar 0b5vr commented on July 26, 2024

いえ、方針問題ないと思います!

from twigl.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.